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(+)

-- 
2.17.1

Reply via email to