diff options
| author | Xu Kuohai <xukuohai@huawei.com> | 2026-06-10 20:17:23 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-06-12 20:33:16 -0700 |
| commit | 4c71303c837449158815c521fcee4ec3b8721dbd (patch) | |
| tree | 16d75c5f6488576b1268c63c7e37ebcc8a6e4edb /include/linux/timerqueue.h | |
| parent | 746145bd7aaa3db2d77ef26aa8f3ebe1ca83cef6 (diff) | |
bpf: Fix setting retval to -EPERM for cgroup hooks not returning errno
When a cgroup BPF program exits with 0, bpf_prog_run_array_cg() sets
the hook return value to -EPERM if it is not a valid errno. This is
correct for errno-based hooks, which return 0 on success and negative
errno on failure, but wrong for boolean and void LSM hooks. Boolean
LSM hooks should only return true or false, and void LSM hooks have
no return value at all.
Fix it by skipping setting -EPERM for hooks not returning errno.
Fixes: 69fd337a975c ("bpf: per-cgroup lsm flavor")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/20260610201724.733943-2-xukuohai@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
