mbox series

[bpf,v3,0/3] bpf: Fix null-pointer-deref in resolve_prog_type()

Message ID 20240710092904.3438141-1-wutengda@huaweicloud.com (mailing list archive)
Headers show
Series bpf: Fix null-pointer-deref in resolve_prog_type() | expand

Message

Tengda Wu July 10, 2024, 9:29 a.m. UTC
v3: 
 - Add a small selftest for the BPF CI, and split 1-patch into
   3-patch series as recommended by Daniel.
   https://lore.kernel.org/all/d16b4f29-8966-464f-b530-35e39fda3f46@huaweicloud.com/

v2: 
 - Fix libbpf_probe_prog_types test failure reported by CI by
   adapting libbpf code. (thanks for jirka's reminder)

v1: https://lore.kernel.org/all/20240620060701.1465291-1-wutengda@huaweicloud.com/

Hi,

This series is going to fix null-pointer-deref in resolve_prog_type()
for BPF_PROG_TYPE_EXT.
Patch 1 is the kernel-only fix, patch 2 is the libbpf one, and patch 3
is a small BPF selftest.

Best regards,
Tengda

Tengda Wu (3):
  bpf: Fix null pointer dereference in resolve_prog_type() for
    BPF_PROG_TYPE_EXT
  libbpf: provide a valid attach_prog_fd before probing
    BPF_PROG_TYPE_EXT type
  selftests/bpf: Test for null-pointer-deref bugfix in
    resolve_prog_type()

 kernel/bpf/syscall.c                         |  5 ++++-
 tools/lib/bpf/libbpf_probes.c                | 13 ++++++++++++-
 tools/testing/selftests/bpf/verifier/calls.c | 13 +++++++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)