From: Stephen Smalley Date: Fri, 3 Feb 2006 13:21:12 +0000 (-0500) Subject: [PATCH] SELinux: fix size-128 slab leak X-Git-Tag: v2.6.16-rc3~204 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ea68ecea11bcbb3451c2758ce181bd97b569a9;p=linux-2.6 [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 --- diff --git a/include/linux/security.h b/include/linux/security.h index bb1da86747..7cbef482e1 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1499,15 +1499,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); }