linux-stable/security/keys
Christian Göttsche 885330095b 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:47:58 +02:00
..
encrypted-keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
Kconfig security/keys: BIG_KEY requires CONFIG_CRYPTO 2017-10-18 09:12:40 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
big_key.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
compat.c
compat_dh.c KEYS: DH: validate __spare field 2017-07-14 11:01:38 +10:00
dh.c Revert "uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name" 2018-09-25 13:28:58 +02:00
gc.c Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-25 08:37:16 -10:00
internal.h mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-22 09:05:01 +02:00
key.c certs: Fix blacklist flag type confusion 2021-03-04 09:39:44 +01:00
keyctl.c security: keys: perform capable check only on privileged operations 2023-09-23 10:47:58 +02:00
keyring.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
permission.c security: keys: Replace time_t/timespec with time64_t 2017-11-15 16:38:45 +00:00
persistent.c
proc.c keys: Fix proc_keys_next to increase position index 2020-04-21 09:03:08 +02:00
process_keys.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
request_key.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
request_key_auth.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
sysctl.c
trusted.c KEYS: trusted: Fix migratable=1 failing 2021-03-04 09:39:53 +01:00
trusted.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
user_defined.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00