mbox series

[bpf-next,0/2] bpf: Fix updating attached freplace prog to PROG_ARRAY map

Message ID 20240725003251.37855-1-leon.hwang@linux.dev (mailing list archive)
Headers show
Series bpf: Fix updating attached freplace prog to PROG_ARRAY map | expand

Message

Leon Hwang July 25, 2024, 12:32 a.m. UTC
The commit f7866c3587337731 ("bpf: Fix null pointer dereference in
resolve_prog_type() for BPF_PROG_TYPE_EXT") fixed a NULL pointer panic, but
does not support my case[0] that I want to update attached freplace prog to
PROG_ARRAY map.

This patchset fixes it to support updating attached freplace prog to
PROG_ARRAY map.

[0] https://lore.kernel.org/bpf/20240602122421.50892-1-hffilwlqm@gmail.com/

RFC PATCH -> v1:
 * Respin the PATCH with updating its message.

Leon Hwang (2):
  bpf: Fix updating attached freplace prog to PROG_ARRAY map
  selftests/bpf: Add testcase for updating attached freplace prog to
    PROG_ARRAY map

 include/linux/bpf_verifier.h                  |  4 +-
 .../selftests/bpf/prog_tests/tailcalls.c      | 76 ++++++++++++++++++-
 .../selftests/bpf/progs/tailcall_freplace.c   | 33 ++++++++
 .../testing/selftests/bpf/progs/tc_bpf2bpf.c  | 23 ++++++
 4 files changed, 133 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/tailcall_freplace.c
 create mode 100644 tools/testing/selftests/bpf/progs/tc_bpf2bpf.c