aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2017-10-04 09:21:58 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2017-10-04 09:21:58 -0700
commit6c795b30f46ff7efec0039095045c2012416670e (patch)
tree5c336215e9356d856d3adf130bdb3078028a485c /fs
parentMerge tag 'trace-v4.14-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
parentlsm: fix smack_inode_removexattr and xattr_getsecurity memleak (diff)
downloadlinux-6c795b30f46ff7efec0039095045c2012416670e.tar.gz
linux-6c795b30f46ff7efec0039095045c2012416670e.tar.bz2
linux-6c795b30f46ff7efec0039095045c2012416670e.zip
Merge branch 'fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull smack fix from James Morris: "It fixes a bug in xattr_getsecurity() where security_release_secctx() was being called instead of kfree(), which leads to a memory leak in the capabilities code. smack_inode_getsecurity is also fixed to behave correctly when called from there" * 'fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: lsm: fix smack_inode_removexattr and xattr_getsecurity memleak
Diffstat (limited to 'fs')
-rw-r--r--fs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xattr.c b/fs/xattr.c
index 4424f7fecf14..61cd28ba25f3 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -250,7 +250,7 @@ xattr_getsecurity(struct inode *inode, const char *name, void *value,
}
memcpy(value, buffer, len);
out:
- security_release_secctx(buffer, len);
+ kfree(buffer);
out_noalloc:
return len;
}