Skip to content

gen_loader fixes

KP Singh bpf linux-security-module 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesIn review 1 of 2 applied
  2. v22 patches 8 repliesSuperseded

Patches in v3 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2libbpf: fix off-by-one in emit_signature_match jump offsettools/lib/bpf/gen_loader.c+1 -20 repliesApplied
2/2bpf, libbpf: reject non-exclusive metadata maps in the signed loaderinclude/linux/bpf.h tools/lib/bpf/gen_loader.c tools/testing/selftests/bpf/progs/verifier_map_ptr.c+23 -43 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH bpf v3 0/2] gen_loader fixes
  # v2 -> v3

defer fixing 32 bit.

Fix off-by-one in the signed loader's cleanup jump and reject non-exclusive metadata maps.

Patch 1 fixes a pre-existing bug: the cleanup-label offset in emit_signature_match() does not account for the MOV insn emitted before the JMP.

Patch 2 adds an exclusivity check so the loader bails if the metadata map lacks excl_prog_hash, preventing stale-hash attacks from concurrent map writers.

KP Singh (2):
libbpf: fix off-by-one in emit_signature_match jump offset bpf, libbpf: reject non-exclusive metadata maps in the signed loader

 include/linux/bpf.h                           |  2 +-
 tools/lib/bpf/gen_loader.c                    | 20 +++++++++++++++++--
 .../selftests/bpf/progs/verifier_map_ptr.c    |  8 +++++---
 3 files changed, 24 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.0