linux-stable/security/keys
Christian Göttsche 3899c1d158 security: keys: perform capable check only on privileged operations
[ Upstream commit 2d7f105edb ]

If the current task fails the check for the queried capability via
`capable(CAP_SYS_ADMIN)` LSMs like SELinux generate a denial message.
Issuing such denial messages unnecessarily can lead to a policy author
granting more privileges to a subject than needed to silence them.

Reorder CAP_SYS_ADMIN checks after the check whether the operation is
actually privileged.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 10:59:39 +02:00
..
encrypted-keys
big_key.c
compat.c
compat_dh.c
dh.c
gc.c
internal.h
Kconfig
key.c certs: Fix blacklist flag type confusion 2021-03-04 10:26:29 +01:00
keyctl.c security: keys: perform capable check only on privileged operations 2023-09-23 10:59:39 +02:00
keyctl_pkey.c KEYS: fix length validation in keyctl_pkey_params_get_2() 2022-04-15 14:17:58 +02:00
keyring.c
Makefile
permission.c
persistent.c
proc.c
process_keys.c
request_key.c keys: Fix linking a duplicate key to a keyring's assoc_array 2023-08-11 11:53:47 +02:00
request_key_auth.c
sysctl.c
trusted.c KEYS: trusted: Fix migratable=1 failing 2021-03-04 10:26:44 +01:00
user_defined.c