public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] properly load insn array values with offsets
@ 2026-01-11 15:30 Anton Protopopov
  2026-01-11 15:30 ` [PATCH bpf-next 1/3] bpf: insn array: return proper address for non-zero offsets Anton Protopopov
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Anton Protopopov @ 2026-01-11 15:30 UTC (permalink / raw)
  To: bpf, Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Eduard Zingerman, Yonghong Song
  Cc: Anton Protopopov

As was reported by the BPF CI bot in [1] the direct address
of an instruction array returned by map_direct_value_addr()
is incorrect if the offset is non-zero. Fix this bug and
add selftests.

Also (commit 2), return EACCES instead of EINVAL when offsets
aren't correct.

  [1] https://lore.kernel.org/bpf/0447c47ac58306546a5dbdbad2601f3e77fa8eb24f3a4254dda3a39f6133e68f@mail.kernel.org/

Anton Protopopov (3):
  bpf: insn array: return proper address for non-zero offsets
  bpf: insn array: return EACCES for incorrect map access
  selftests/bpf: add tests for loading map values with offsets

 kernel/bpf/bpf_insn_array.c                   |   4 +-
 .../selftests/bpf/prog_tests/bpf_gotox.c      | 208 ++++++++++++++++++
 2 files changed, 210 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-14 10:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11 15:30 [PATCH bpf-next 0/3] properly load insn array values with offsets Anton Protopopov
2026-01-11 15:30 ` [PATCH bpf-next 1/3] bpf: insn array: return proper address for non-zero offsets Anton Protopopov
2026-01-12 17:05   ` Emil Tsalapatis
2026-01-14  3:42   ` Alexei Starovoitov
2026-01-14 10:20     ` Anton Protopopov
2026-01-11 15:30 ` [PATCH bpf-next 2/3] bpf: insn array: return EACCES for incorrect map access Anton Protopopov
2026-01-12 17:12   ` Emil Tsalapatis
2026-01-12 18:45     ` Anton Protopopov
2026-01-12 19:18       ` Emil Tsalapatis
2026-01-11 15:30 ` [PATCH bpf-next 3/3] selftests/bpf: add tests for loading map values with offsets Anton Protopopov
2026-01-14  3:40 ` [PATCH bpf-next 0/3] properly load insn array " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox