]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - fs/overlayfs/super.c
ovl: fix nested overlayfs mount
authorAmir Goldstein <amir73il@gmail.com>
Wed, 16 Nov 2016 09:22:39 +0000 (11:22 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 16 Dec 2016 10:02:56 +0000 (11:02 +0100)
commit48fab5d7c750ff70aa77c36a44c01211020bbc98
tree50e8ac4df65410b5ae9ea9d4e083e7ddf3ebff37
parent6b2d5fe46fa8f4fc1c5262c73930b9a2a94db2e3
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>
fs/overlayfs/super.c