All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] security/commoncap: Use xattr security prefix len
@ 2019-07-06 15:07 Carmeli Tamir
  2019-07-07  3:02 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Carmeli Tamir @ 2019-07-06 15:07 UTC (permalink / raw)
  To: serge, jmorris, linux-security-module, linux-kernel; +Cc: Carmeli Tamir

Using the existing defined XATTR_SECURITY_PREFIX_LEN instead of
sizeof(XATTR_SECURITY_PREFIX) - 1. Pretty simple cleanup.

Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>
---
 security/commoncap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index c0b9664ee49e..99d1fcae22fd 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -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) {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] security/commoncap: Use xattr security prefix len
  2019-07-06 15:07 [PATCH] security/commoncap: Use xattr security prefix len Carmeli Tamir
@ 2019-07-07  3:02 ` James Morris
  0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2019-07-07  3:02 UTC (permalink / raw)
  To: Carmeli Tamir; +Cc: serge, linux-security-module, linux-kernel

On Sat, 6 Jul 2019, Carmeli Tamir wrote:

> Using the existing defined XATTR_SECURITY_PREFIX_LEN instead of
> sizeof(XATTR_SECURITY_PREFIX) - 1. Pretty simple cleanup.
> 
> Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lsm

Thanks! 

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-07  3:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-06 15:07 [PATCH] security/commoncap: Use xattr security prefix len Carmeli Tamir
2019-07-07  3:02 ` James Morris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.