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>
Sun, 31 Dec 2023 15:46:35 +0000 (16:46 +0100)
commit2974d781fd6ff3e976051da60d20aabba00a1465
treeba09c532b0df9e26309b0d8de31b4b13ba8f71f9
parentdc981fa0176fa96ef3c08b38bac58c8a6614b006
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