summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-04 09:21:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-04 09:21:58 -0700
commit6c795b30f46ff7efec0039095045c2012416670e (patch)
tree5c336215e9356d856d3adf130bdb3078028a485c /fs
parent013a8ee6284280f8032cadfec37bcc3cfbfff81b (diff)
parent57e7ba04d422c3d41c8426380303ec9b7533ded9 (diff)
downloadlinux-6c795b30f46ff7efec0039095045c2012416670e.tar.bz2
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;
}