]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
apparmor: fix refcount race when finding a child profile
authorJohn Johansen <john.johansen@canonical.com>
Thu, 17 Dec 2015 02:09:10 +0000 (18:09 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Tue, 12 Jul 2016 15:43:10 +0000 (08:43 -0700)
commitde7c4cc947f9f56f61520ee7edaf380434a98c8d
tree8da638b921498bba5fca1fc2b4192166f45700ef
parent0b938a2e2cf0b0a2c8bac9769111545aff0fee97
apparmor: fix refcount race when finding a child profile

When finding a child profile via an rcu critical section, the profile
may be put and scheduled for deletion after the child is found but
before its refcount is incremented.

Protect against this by repeating the lookup if the profiles refcount
is 0 and is one its way to deletion.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
security/apparmor/policy.c