Skip to content
Snippets Groups Projects
Commit c09ffff2 authored by Ondrej Mosnacek's avatar Ondrej Mosnacek Committed by Sasha Levin
Browse files

lsm: fix default return value of the socket_getpeersec_*() hooks


[ Upstream commit 5a287d3d ]

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: 98e828a0 ("security: Refactor declaration of LSM hooks")
Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
[PM: subject line tweak]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ea6e87db
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment