TencentOS-kernel/security
Miklos Szeredi 02698123e7 cap: fix conversions on getxattr
[ Upstream commit f2b00be488730522d0fb7a8a5de663febdcefe0a ]

If a capability is stored on disk in v2 format cap_inode_getsecurity() will
currently return in v2 format unconditionally.

This is wrong: v2 cap should be equivalent to a v3 cap with zero rootid,
and so the same conversions performed on it.

If the rootid cannot be mapped, v3 is returned unconverted.  Fix this so
that both v2 and v3 return -EOVERFLOW if the rootid (or the owner of the fs
user namespace in case of v2) cannot be mapped into the current user
namespace.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-12 12:52:02 +08:00
..
apparmor apparmor: ensure that dfa state tables have entries 2021-03-16 16:32:02 +08:00
integrity ima: Don't modify file descriptor mode on the fly 2021-03-16 16:43:35 +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 cap: fix conversions on getxattr 2021-04-12 12:52:02 +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