vfs: move cap_convert_nscap() call into vfs_setxattr()
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 14 Dec 2020 14:26:13 +0000 (15:26 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Wed, 16 Aug 2023 20:52:03 +0000 (21:52 +0100)
commitf0694e3dd736ff22e58c76237c7354c12c3fdd0f
tree4a112ce7baf9337cb6d191cac62e6d8d3bb6d478
parentd6b3fc2e6ade22f493b8441497713636f420dc49
vfs: move cap_convert_nscap() call into vfs_setxattr()

Origin: https://git.kernel.org/linus/7c03e2cda4a584cadc398e8f6641ca9988a39d52
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2021-3493

cap_convert_nscap() does permission checking as well as conversion of the
xattr value conditionally based on fs's user-ns.

This is needed by overlayfs and probably other layered fs (ecryptfs) and is
what vfs_foo() is supposed to do anyway.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: James Morris <jamorris@linux.microsoft.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name vfs-move-cap_convert_nscap-call-into-vfs_setxattr.patch
fs/xattr.c
include/linux/capability.h
security/commoncap.c