kernel_samsung_a53x/security
Ondrej Mosnacek ba9c74fba5 lsm: fix default return value of the socket_getpeersec_*() hooks
[ Upstream commit 5a287d3d2b9de2b3e747132c615599907ba5c3c1 ]

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: 98e828a0650f ("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-11-18 23:19:51 +01:00
..
apparmor lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-11-18 23:19:51 +01:00
bpf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
integrity ima: detect changes to the backing overlay file 2024-11-18 11:43:25 +01:00
keys keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-11-18 12:11:59 +01:00
loadpin Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lockdown Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
safesetid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
samsung security: samsung: defex_lsm: nuke 2024-06-15 16:20:49 -03:00
sdp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
selinux lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-11-18 23:19:51 +01:00
smack lsm: make security_socket_getpeersec_stream() sockptr_t safe 2024-11-18 23:19:51 +01:00
tomoyo tomoyo: fix UAF write bug in tomoyo_write_control() 2024-11-18 23:18:29 +01:00
yama Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
commoncap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
device_cgroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig security: samsung: defex_lsm: nuke 2024-06-15 16:20:49 -03:00
Kconfig.hardening Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lsm_audit.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile security: samsung: defex_lsm: nuke 2024-06-15 16:20:49 -03:00
min_addr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
security.c lsm: fix default return value of the socket_getpeersec_*() hooks 2024-11-18 23:19:51 +01:00