linux-stable/security
Ondrej Mosnacek c09ffff246 lsm: fix default return value of the socket_getpeersec_*() hooks
[ Upstream commit 5a287d3d2b ]

For these hooks the true "neutral" value is -EOPNOTSUPP, which is
currently what is returned when no LSM provides this hook and what LSMs
return when there is no security context set on the socket. Correct the
value in <linux/lsm_hooks.h> and adjust the dispatch functions in
security/security.c to avoid issues when the BPF LSM is enabled.

Cc: stable@vger.kernel.org
Fixes: 98e828a065 ("security: Refactor declaration of LSM hooks")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-15 10:48:20 -04:00
..
apparmor lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-03-15 10:48:20 -04:00
bpf bpf: Implement bpf_local_storage for inodes 2020-08-25 15:00:04 -07:00
integrity ima: annotate iint mutex to avoid lockdep false positive warnings 2023-12-08 08:46:15 +01:00
keys keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-01-05 15:12:25 +01:00
loadpin LoadPin: Ignore the "contents" argument of the LSM hooks 2023-01-14 10:16:22 +01:00
lockdown
safesetid LSM: SafeSetID: Fix warnings reported by test bot 2020-10-13 09:17:36 -07:00
selinux lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-03-15 10:48:20 -04:00
smack lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-03-15 10:48:20 -04:00
tomoyo tomoyo: fix UAF write bug in tomoyo_write_control() 2024-03-06 14:37:49 +00:00
yama task_work: cleanup notification modes 2020-10-17 15:05:30 -06:00
Kconfig x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
Kconfig.hardening hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero 2022-10-26 13:25:12 +02:00
Makefile
commoncap.c capabilities: fix potential memleak on error path from vfs_getxattr_alloc() 2022-11-10 18:14:26 +01:00
device_cgroup.c device_cgroup: Roll back to original exceptions after copy failure 2023-01-14 10:16:36 +01:00
inode.c
lsm_audit.c dump_common_audit_data(): fix racy accesses to ->d_name 2021-01-19 18:27:29 +01:00
min_addr.c
security.c lsm: fix default return value of the socket_getpeersec_*() hooks 2024-03-15 10:48:20 -04:00