Skip to content

properly load insn array values with offsets

Anton Protopopov bpf 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: insn array: return proper address for non-zero offsetskernel/bpf/bpf_insn_array.c+1 -13 repliesApplied
2/3bpf: insn array: return EACCES for incorrect map accesskernel/bpf/bpf_insn_array.c+1 -13 repliesApplied
3/3selftests/bpf: add tests for loading map values with offsetstools/testing/selftests/bpf/prog_tests/bpf_gotox.c+208 -00 repliesApplied

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchEmil Tsalapatis
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] properly load insn array values with offsets

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(-)
Signature · 1 line
2.34.1