Files
android_kernel_xiaomi_sm8450/include/linux
Ondrej Mosnacek 8e29eebe4c 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: 98e828a065 ("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>
2023-11-28 16:55:00 +00:00
..
2023-08-26 15:26:49 +02:00
2022-08-21 15:16:16 +02:00
2022-10-26 13:25:35 +02:00
2023-10-10 21:53:37 +02:00
2020-10-02 15:00:49 -07:00
2020-10-16 17:21:51 +02:00
2020-08-12 20:42:08 +02:00
2020-08-04 21:02:38 -04:00
2023-10-25 11:54:20 +02:00
2022-10-26 13:25:42 +02:00
2020-09-16 08:54:53 -05:00
2023-03-17 08:45:07 +01:00
2023-03-17 08:45:07 +01:00
2020-08-26 12:41:56 +02:00
2020-11-19 22:38:29 -05:00
2021-03-04 11:37:59 +01:00
2022-08-21 15:16:08 +02:00
2020-09-04 09:25:20 -07:00
2021-02-07 15:37:17 +01:00
2022-08-21 15:15:21 +02:00
2020-09-04 12:46:07 +01:00
2021-06-30 08:47:26 -04:00
2020-08-27 16:06:47 -04:00
2023-01-04 11:39:16 +01:00
2023-11-20 11:06:46 +01:00
2023-06-21 15:45:38 +02:00
2020-10-07 14:28:39 -04:00
2023-08-26 15:26:57 +02:00
2020-08-31 12:52:33 -07:00
2021-03-30 14:32:05 +02:00
2020-10-18 09:27:10 -07:00
2023-11-28 16:54:53 +00:00
2023-10-25 11:54:13 +02:00
2023-10-25 11:54:13 +02:00
2020-08-18 17:06:15 +02:00
2020-08-07 11:33:24 -07:00
2020-09-26 22:55:05 -04:00
2021-05-07 11:04:32 +02:00
2021-05-14 09:50:18 +02:00
2023-05-17 11:48:09 +02:00
2021-05-14 09:50:31 +02:00
2020-09-10 14:03:31 -07:00
2023-10-25 11:54:21 +02:00
2020-10-05 13:21:49 +02:00