Merge tag 'apparmor-pr-2019-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Mar 2019 18:07:36 +0000 (11:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Mar 2019 18:07:36 +0000 (11:07 -0700)
Pull apparmor fixes from John Johansen:

 - fix double when failing to unpack secmark rules in policy

 - fix leak of dentry when profile is removed

* tag 'apparmor-pr-2019-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
  apparmor: fix double free when unpack of secmark rules fails
  apparmor: delete the dentry in aafs_remove() to avoid a leak
  apparmor: Fix warning about unused function apparmor_ipv6_postroute

security/apparmor/apparmorfs.c
security/apparmor/policy_unpack.c

index 3f80a684c232addd0b498241b603ba828dd7c0eb..fefee040bf79132e03864320d6c5e19b83907094 100644 (file)
@@ -356,6 +356,7 @@ static void aafs_remove(struct dentry *dentry)
                        simple_rmdir(dir, dentry);
                else
                        simple_unlink(dir, dentry);
+               d_delete(dentry);
                dput(dentry);
        }
        inode_unlock(dir);
index 379682e2a8d5db7e793fd1ebdd3d93f569bb3b4c..f6c2bcb2ab1456be2037ca0c4d2f25175fc2c0b3 100644 (file)
@@ -579,6 +579,7 @@ fail:
                        kfree(profile->secmark[i].label);
                kfree(profile->secmark);
                profile->secmark_count = 0;
+               profile->secmark = NULL;
        }
 
        e->pos = pos;