提交 ba1b7309 编写于 作者: L Linus Torvalds

Merge branch 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull smack update from James Morris:
 "From Casey:

    One simple patch that fixes a memory leak in kernfs and labeled NFS"

* 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  Smack: Fix memory leak in smack_inode_getsecctx
...@@ -1545,9 +1545,9 @@ static int smack_inode_listsecurity(struct inode *inode, char *buffer, ...@@ -1545,9 +1545,9 @@ static int smack_inode_listsecurity(struct inode *inode, char *buffer,
*/ */
static void smack_inode_getsecid(struct inode *inode, u32 *secid) static void smack_inode_getsecid(struct inode *inode, u32 *secid)
{ {
struct inode_smack *isp = inode->i_security; struct smack_known *skp = smk_of_inode(inode);
*secid = isp->smk_inode->smk_secid; *secid = skp->smk_secid;
} }
/* /*
...@@ -4559,12 +4559,10 @@ static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) ...@@ -4559,12 +4559,10 @@ static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
{ {
int len = 0; struct smack_known *skp = smk_of_inode(inode);
len = smack_inode_getsecurity(inode, XATTR_SMACK_SUFFIX, ctx, true);
if (len < 0) *ctx = skp->smk_known;
return len; *ctxlen = strlen(skp->smk_known);
*ctxlen = len;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册