[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.00.1003021901170.1594@tundra.namei.org>
Date: Tue, 2 Mar 2010 19:01:49 +1100 (EST)
From: James Morris <jmorris@...ei.org>
To: linux-fsdevel@...r.kernel.org
cc: linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
David Woodhouse <dwmw2@...radead.org>,
Joel Becker <joel.becker@...cle.com>,
Mark Fasheh <mfasheh@...e.com>, Alex Elder <aelder@....com>,
Chris Mason <chris.mason@...cle.com>,
a.gruenbacher@...puter.org
Subject: [PATCH 1/2] jffs2: ensure trusted xattrs are not returned to
unprivileged users via listxattr
Ensure that trusted xattrs are not returned to unprivileged users
via listxattr, in keeping with several other implmentations, such
as ext3.
Signed-off-by: James Morris <jmorris@...ei.org>
---
fs/jffs2/xattr_trusted.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/jffs2/xattr_trusted.c b/fs/jffs2/xattr_trusted.c
index 3e5a5e3..405121c 100644
--- a/fs/jffs2/xattr_trusted.c
+++ b/fs/jffs2/xattr_trusted.c
@@ -39,6 +39,9 @@ static size_t jffs2_trusted_listxattr(struct dentry *dentry, char *list,
{
size_t retlen = XATTR_TRUSTED_PREFIX_LEN + name_len + 1;
+ if (!capable(CAP_SYS_ADMIN))
+ return 0;
+
if (list && retlen<=list_size) {
strcpy(list, XATTR_TRUSTED_PREFIX);
strcpy(list + XATTR_TRUSTED_PREFIX_LEN, name);
--
1.6.3.3
--
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