Patch "ovl: filter trusted xattr for non-admin" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
ovl: filter trusted xattr for non-admin
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ovl-filter-trusted-xattr-for-non-admin.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Apr 9 17:09:24 CEST 2018
From: Miklos Szeredi <[email protected]>
Date: Mon, 29 May 2017 15:15:27 +0200
Subject: ovl: filter trusted xattr for non-admin
From: Miklos Szeredi <[email protected]>
[ Upstream commit a082c6f680da298cf075886ff032f32ccb7c5e1a ]
Filesystems filter out extended attributes in the "trusted." domain for unprivlieged callers.
Overlay calls underlying filesystem's method with elevated privs, so need to do the filtering in overlayfs too.
--- fs/overlayfs/inode.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/overlayfs/inode.c +11 -1
@@ -227,6 +227,16 @@ int ovl_xattr_get(struct dentry *dentry,return res; } +static bool ovl_can_list (const char *s) +{ +/* List all non-trusted xatts */ +if (strncmp (s,XATTR_TRUSTED_PREFIX ,XATTR_TRUSTED_PREFIX_LEN ) !=0 ) +return true; + +/* Never list trusted.overlay, list other trusted for superuser only */ +return !ovl_is_private_xattr (s) &&capable (CAP_SYS_ADMIN ); +} +ssize_t ovl_listxattr (struct dentry *dentry,char *list,size_t size) {struct dentry *realdentry =ovl_dentry_real (dentry);
@@ -250,7 +260,7 @@ ssize_t ovl_listxattr(struct dentry *denreturn -EIO ; len -= slen; -if (ovl_is_private_xattr (s)) { +if (!ovl_can_list (s)) { res -= slen;memmove (s, s + slen, len); }else {
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/ovl-persistent-inode-numbers-for-upper-hardlinks.patch queue-4.9/ovl-filter-trusted-xattr-for-non-admin.patch