diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2023-10-31 13:32:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-28 17:07:18 +0000 |
commit | cfcb1e7c17c32fe1eef796033163a9bdfd19e678 (patch) | |
tree | e0ff75b4d58ddb8a4bceb51c61c3a6ba9ab139b6 /drivers/watchdog | |
parent | 7a048a90ac3ecfd980398b882c5d21650293ae38 (diff) | |
download | linux-cfcb1e7c17c32fe1eef796033163a9bdfd19e678.tar.gz linux-cfcb1e7c17c32fe1eef796033163a9bdfd19e678.tar.bz2 linux-cfcb1e7c17c32fe1eef796033163a9bdfd19e678.zip |
lsm: fix default return value for inode_getsecctx
commit b36995b8609a5a8fe5cf259a1ee768fcaed919f8 upstream.
-EOPNOTSUPP is the return value that implements a "no-op" hook, not 0.
Without this fix having only the BPF LSM enabled (with no programs
attached) can cause uninitialized variable reads in
nfsd4_encode_fattr(), because the BPF hook returns 0 without touching
the 'ctxlen' variable and the corresponding 'contextlen' variable in
nfsd4_encode_fattr() remains uninitialized, yet being treated as valid
based on the 0 return value.
Cc: stable@vger.kernel.org
Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks")
Reported-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/watchdog')
0 files changed, 0 insertions, 0 deletions