TencentOS-kernel/security
Eric W. Biederman 5e2eb59b05 capabilities: Don't allow writing ambiguous v3 file capabilities
[ Upstream commit 95ebabde382c371572297915b104e55403674e73 ]

The v3 file capabilities have a uid field that records the filesystem
uid of the root user of the user namespace the file capabilities are
valid in.

When someone is silly enough to have the same underlying uid as the
root uid of multiple nested containers a v3 filesystem capability can
be ambiguous.

In the spirit of don't do that then, forbid writing a v3 filesystem
capability if it is ambiguous.

Fixes: 8db6c34f1dbc ("Introduce v3 namespaced file capabilities")
Reviewed-by: Andrew G. Morgan <morgan@kernel.org>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-12 12:52:22 +08:00
..
apparmor apparmor: ensure that dfa state tables have entries 2021-03-16 16:32:02 +08:00
integrity ima: Free IMA measurement buffer after kexec syscall 2021-04-12 12:52:21 +08:00
keys mm: add kvfree_sensitive() for freeing sensitive data objects 2021-03-16 16:28:58 +08:00
loadpin Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lockdown lockdown: Allow unprivileged users to see lockdown status 2021-03-16 16:29:19 +08:00
safesetid Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
selinux selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling 2021-03-16 16:42:41 +08:00
smack Smack: prevent underflow in smk_set_cipso() 2021-03-16 16:33:40 +08:00
tomoyo Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
yama Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig.hardening Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
commoncap.c capabilities: Don't allow writing ambiguous v3 file capabilities 2021-04-12 12:52:22 +08:00
device_cgroup.c device_cgroup: Fix RCU list debugging warning 2021-03-16 16:37:29 +08:00
inode.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lsm_audit.c dump_common_audit_data(): fix racy accesses to ->d_name 2021-04-12 12:51:25 +08:00
min_addr.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
security.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00