]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Return EACCES for incorrect access to insn array
authorAnton Protopopov <a.s.protopopov@gmail.com>
Sun, 11 Jan 2026 15:30:46 +0000 (15:30 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 14 Jan 2026 03:36:18 +0000 (19:36 -0800)
commit7e525860e7250355bcb01ae9779154512b5e5e88
treec24ad62877733009ffbcdd5c934c649e404cb219
parente3bd7bdf5ffe49d8381e42843f6e98cd0c78a1e8
bpf: Return EACCES for incorrect access to insn array

The insn_array_map_direct_value_addr() function currently returns
-EINVAL when the offset within the map is invalid. Change this to
return -EACCES, so that it is consistent with similar boundary access
checks in the verifier.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260111153047.8388-3-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/bpf_insn_array.c