Skip to content

Ensure line_info.insn_off cannot point to insn with zero code

Martin KaFai Lau netdev 1 version Applied

Status from this message: Applied, Thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2bpf: Ensure line_info.insn_off cannot point to insn with zero codekernel/bpf/verifier.c+8 -00 replies
2/2bpf: Add BPF_LD_IMM64 to the line_info testtools/testing/selftests/bpf/test_btf.c+27 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYonghong Song
SeriesA-b
1/2
2/2

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/2] Ensure line_info.insn_off cannot point to insn with zero code

This series ensures the line_info (passed by the userspace during bpf_prog_load) cannot have its line_info.insn_off pointing to a zero bpf insn code. F.e. a broken userspace tool might generate a line_info.insn_off that points to the second 8 bytes of a BPF_LD_IMM64.

The first patch is the kernel change.
The second patch is a new test case.

Martin KaFai Lau (2):
bpf: Ensure line_info.insn_off cannot point to insn with zero code
bpf: Add BPF_LD_IMM64 to the line_info test

 kernel/bpf/verifier.c                  |  8 ++++++++
 tools/testing/selftests/bpf/test_btf.c | 27 ++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
Signature · 1 line
2.17.1