From: Stephen Smalley Date: Sat, 4 Feb 2006 03:57:49 +0000 (-0800) Subject: [PATCH] SELinux: fix size-128 slab leak X-Git-Tag: v2.6.15.4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e52f025124c75a64a59a19b0658e47b57d11aa5;p=thirdparty%2Fkernel%2Fstable.git [PATCH] SELinux: fix size-128 slab leak Remove private inode tests from security_inode_alloc and security_inode_free, as we otherwise end up leaking inode security structures for private inodes. Signed-off-by: Stephen Smalley Acked-by: James Morris Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/security.h b/include/linux/security.h index f7e0ae0187122..203fce096d4ce 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1437,15 +1437,11 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd, static inline int security_inode_alloc (struct inode *inode) { - if (unlikely (IS_PRIVATE (inode))) - return 0; return security_ops->inode_alloc_security (inode); } static inline void security_inode_free (struct inode *inode) { - if (unlikely (IS_PRIVATE (inode))) - return; security_ops->inode_free_security (inode); }