summaryrefslogtreecommitdiff
path: root/fs/jffs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-10-04 20:18:50 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2015-11-14 04:34:30 +0300
commitbf781714b3e1421a0ebcd0137d081e6566a89f15 (patch)
tree63c53e010b663b46a3eb9db757ce8da0fac75bf3 /fs/jffs2
parente282fb7f3bce68089ae2b40c227b015c23764a38 (diff)
downloadlinux-bf781714b3e1421a0ebcd0137d081e6566a89f15.tar.xz
jffs2: Add missing capability check for listing trusted xattrs
The vfs checks if a task has the appropriate access for get and set operations, but it cannot do that for the list operation; the file system must check for that itself. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-mtd@lists.infradead.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/xattr_trusted.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/jffs2/xattr_trusted.c b/fs/jffs2/xattr_trusted.c
index ceaf9c693225..bbd20c16090e 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);