security/commoncap: Use xattr security prefix len
Subsystems (2)
PATCH 1/1 security/commoncap: Use xattr security prefix len
Using the existing defined XATTR_SECURITY_PREFIX_LEN instead of sizeof(XATTR_SECURITY_PREFIX) - 1. Pretty simple cleanup.
Signed-off-by Carmeli Tamir <[email protected]>
--- security/commoncap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/commoncap.c +2 -2
@@ -915,7 +915,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,/* Ignore non-security xattrs */ if (strncmp (name,XATTR_SECURITY_PREFIX , -sizeof (XATTR_SECURITY_PREFIX ) -1 ) !=0 ) +XATTR_SECURITY_PREFIX_LEN ) !=0 )return 0 ;/*
@@ -947,7 +947,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name)/* Ignore non-security xattrs */ if (strncmp (name,XATTR_SECURITY_PREFIX , -sizeof (XATTR_SECURITY_PREFIX ) -1 ) !=0 ) +XATTR_SECURITY_PREFIX_LEN ) !=0 )return 0 ;if (strcmp (name,XATTR_NAME_CAPS ) ==0 ) {
Signature · 1 line
2.21.0
James Morris
maintainerQuoted 4 lines · Carmeli Tamir
Using the existing defined
XATTR_SECURITY_PREFIX_LENinstead ofsizeof(XATTR_SECURITY_PREFIX)- 1. Pretty simple cleanup.Signed-off-by Carmeli Tamir <[email protected]>
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lsm
Thanks!
Signature · 2 lines
James Morris <[email protected]>