diff options
author | Amir Goldstein <amir73il@gmail.com> | 2016-11-16 04:22:39 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 05:02:56 -0500 |
commit | 48fab5d7c750ff70aa77c36a44c01211020bbc98 (patch) | |
tree | 50e8ac4df65410b5ae9ea9d4e083e7ddf3ebff37 /fs/overlayfs/super.c | |
parent | 6b2d5fe46fa8f4fc1c5262c73930b9a2a94db2e3 (diff) |
ovl: fix nested overlayfs mount
When the upper overlayfs checks "trusted.overlay.*" xattr on the underlying
overlayfs mount, it gets -EPERM, which confuses the upper overlayfs.
Fix this by returning -EOPNOTSUPP instead of -EPERM from
ovl_own_xattr_get() and ovl_own_xattr_set(). This behavior is consistent
with the behavior of ovl_listxattr(), which filters out the private
overlayfs xattrs.
Note: nested overlays are deprecated. But this change makes sense
regardless: these xattrs are private to the overlay and should always be
hidden. Hence getting and setting them should indicate this.
[SzMi: Use EOPNOTSUPP instead of ENODATA and use it for both getting and
setting "trusted.overlay." xattrs. This is a perfectly valid error code
for "we don't support this prefix", which is the case here.]
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e19e2ed6a4fd..aadb25413e6e 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c | |||
@@ -603,7 +603,7 @@ static int ovl_own_xattr_get(const struct xattr_handler *handler, | |||
603 | struct dentry *dentry, struct inode *inode, | 603 | struct dentry *dentry, struct inode *inode, |
604 | const char *name, void *buffer, size_t size) | 604 | const char *name, void *buffer, size_t size) |
605 | { | 605 | { |
606 | return -EPERM; | 606 | return -EOPNOTSUPP; |
607 | } | 607 | } |
608 | 608 | ||
609 | static int ovl_own_xattr_set(const struct xattr_handler *handler, | 609 | static int ovl_own_xattr_set(const struct xattr_handler *handler, |
@@ -611,7 +611,7 @@ static int ovl_own_xattr_set(const struct xattr_handler *handler, | |||
611 | const char *name, const void *value, | 611 | const char *name, const void *value, |
612 | size_t size, int flags) | 612 | size_t size, int flags) |
613 | { | 613 | { |
614 | return -EPERM; | 614 | return -EOPNOTSUPP; |
615 | } | 615 | } |
616 | 616 | ||
617 | static int ovl_other_xattr_get(const struct xattr_handler *handler, | 617 | static int ovl_other_xattr_get(const struct xattr_handler *handler, |