lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Oct 2008 08:15:50 -0700
From:	Casey Schaufler <casey@...aufler-ca.com>
To:	linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
CC:	Rob MacKinnon <c4blem0nkey@...il.com>,
	Andreas Gruenbacher <agruen@...e.de>,
	Stephen Smalley <sds@...ho.nsa.gov>, rob.mackinnon@...il.com,
	hpa@...or.com, hugh@...itas.com
Subject: [PATCH] smack inode_listsecurity fix

From: Casey Schaufler <casey@...aufler-ca.com>

This patch fixes the problem known by "tmpfs support of xattrs?"
which is in fact the result of a bad implementation of the
inode_listsecurity LSM hook in Smack. Thanks to Stephen Smalley,
who identified the problem and all but coded the fix before I'd
even heard about it.

Signed-off-by: Casey Schaufler <casey@...aufler-ca.com>

---

 security/smack/smack_lsm.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff -uprN -X linux-2.6/Documentation/dontdiff linux-2.6/security/smack/smack_lsm.c linux-smack/security/smack/smack_lsm.c
--- linux-2.6/security/smack/smack_lsm.c	2008-10-26 17:37:08.000000000 -0700
+++ linux-smack/security/smack/smack_lsm.c	2008-10-26 19:11:23.000000000 -0700
@@ -763,13 +763,11 @@ static int smack_inode_getsecurity(const
 static int smack_inode_listsecurity(struct inode *inode, char *buffer,
 				    size_t buffer_size)
 {
-	int len = strlen(XATTR_NAME_SMACK);
+	int len = sizeof(XATTR_NAME_SMACK);
 
-	if (buffer != NULL && len <= buffer_size) {
+	if (buffer != NULL && len <= buffer_size)
 		memcpy(buffer, XATTR_NAME_SMACK, len);
-		return len;
-	}
-	return -EINVAL;
+	return len;
 }
 
 /**



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ