linux-stable/fs/overlayfs
Vivek Goyal 993a0b2aec ovl: Do not lose security.capability xattr over metadata file copy-up
If a file has been copied up metadata only, and later data is copied up,
upper loses any security.capability xattr it has (underlying filesystem
clears it as upon file write).

From a user's point of view, this is just a file copy-up and that should
not result in losing security.capability xattr.  Hence, before data copy
up, save security.capability xattr (if any) and restore it on upper after
data copy up is complete.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Fixes: 0c28887493 ("ovl: A new xattr OVL_XATTR_METACOPY for file on upper")
Cc: <stable@vger.kernel.org> # v4.19+
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2019-02-13 11:14:46 +01:00
..
copy_up.c ovl: Do not lose security.capability xattr over metadata file copy-up 2019-02-13 11:14:46 +01:00
dir.c ovl: fix missing override creds in link of a metacopy upper 2018-11-19 16:21:29 +01:00
export.c ovl: fix decode of dir file handle with multi lower layers 2018-11-21 10:44:48 +01:00
file.c vfs: plumb remap flags through the vfs dedupe functions 2018-10-30 10:42:03 +11:00
inode.c Revert "ovl: relax permission checking on underlying layers" 2018-12-04 11:31:30 +01:00
Kconfig ovl: Provide a mount option metacopy=on/off for metadata copyup 2018-07-20 09:56:06 +02:00
Makefile ovl: stack file ops 2018-07-18 15:44:41 +02:00
namei.c ovl: fix error handling in ovl_verify_set_fh() 2018-10-26 23:34:39 +02:00
overlayfs.h ovl: Do not lose security.capability xattr over metadata file copy-up 2019-02-13 11:14:46 +01:00
ovl_entry.h ovl: Store lower data inode in ovl_inode 2018-07-20 09:56:11 +02:00
readdir.c ovl: fix wrong use of impure dir cache in ovl_iterate() 2018-07-17 16:04:34 +02:00
super.c ovl: automatically enable redirect_dir on metacopy=on 2018-11-01 21:31:39 +01:00
util.c ovl: Do not lose security.capability xattr over metadata file copy-up 2019-02-13 11:14:46 +01:00