[apparmor] [PATCH 07/15] apparmor: remove previous field from aa_task_cxt

John Johansen john.johansen at canonical.com
Fri Jul 13 23:52:32 UTC 2012


On 07/12/2012 02:26 PM, Seth Arnold wrote:
> This block loses the aa_put_profile() before overwriting the pointer, is this intentional?
> 
> -aa_put_profile(cxt->profile);
> -cxt->profile = aa_newest_version(cxt->previous);
> +p = cxt->profile;
> +cxt->profile = aa_get_profile(aa_newest_version(p->parent));
> 
yes very deliberate, and if you look further down its a matter of moving when
the put is done, to after the dereference in

+ cxt->profile = aa_get_profile(aa_newest_version(p->parent));

since there is no previous field holding the reference any more and we are
finding it through the current profile, this is necessary or we are going
to introduce a race



More information about the AppArmor mailing list