mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
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>
This commit is contained in:
parent
e282fb7f3b
commit
bf781714b3
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
size_t retlen = XATTR_TRUSTED_PREFIX_LEN + name_len + 1;
|
||||||
|
|
||||||
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (list && retlen<=list_size) {
|
if (list && retlen<=list_size) {
|
||||||
strcpy(list, XATTR_TRUSTED_PREFIX);
|
strcpy(list, XATTR_TRUSTED_PREFIX);
|
||||||
strcpy(list + XATTR_TRUSTED_PREFIX_LEN, name);
|
strcpy(list + XATTR_TRUSTED_PREFIX_LEN, name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue