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>
Fri, 29 Sep 2023 04:25:15 +0000 (05:25 +0100)
commit8dd152aaa759dd8231f4200c7f01d5dcd14cbef0
tree5598b9c7e1720e760fecac3050132c3f5a270cfe
parentcb003b750d4e3ad0295e130fde6798ae09646eff
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