Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ab52932 authored by Ondrej Mosnacek's avatar Ondrej Mosnacek Committed by Sahil Sonar
Browse files

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



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")
Change-Id: Ib073b05056bd722f877b89681fd3d859ca8269f8
Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
[PM: subject line tweak]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent c2c38363
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment