BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/2] bpf: Fix updating attached freplace prog to prog_array map
@ 2024-07-28 11:46 Leon Hwang
  2024-07-28 11:46 ` [PATCH bpf-next v3 1/2] " Leon Hwang
  2024-07-28 11:46 ` [PATCH bpf-next v3 2/2] selftests/bpf: Add testcase for " Leon Hwang
  0 siblings, 2 replies; 7+ messages in thread
From: Leon Hwang @ 2024-07-28 11:46 UTC (permalink / raw)
  To: bpf
  Cc: ast, daniel, andrii, toke, martin.lau, eddyz87, yonghong.song,
	wutengda, leon.hwang, kernel-patches-bot

The commit f7866c358733 ("bpf: Fix null pointer dereference in resolve_prog_type() for BPF_PROG_TYPE_EXT")
fixed a NULL pointer dereference panic, but didn't fix the issue that
fails to update attached freplace prog to prog_array map.

This patch fixes the issue.

v2 -> v3:
 * Address comments from Yonghong:
   * Use 12 alphanums for commit ID.
   * Keep commit subject in the same line.
   * Remove some unnecessary empty lines.

v1 -> v2:
 * Address comments from Yonghong:
   * Check then return prog->aux->saved_dst_prog_type.
   * Remove ASSERT_GE() that checks prog_fd and map_fd.
   * Remove #include "bpf_legacy.h".
   * Fix some code style issues.

RFC PATCH -> v1:
 * Respin the PATCH with updated 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      | 65 ++++++++++++++++++-
 .../selftests/bpf/progs/tailcall_freplace.c   | 23 +++++++
 .../testing/selftests/bpf/progs/tc_bpf2bpf.c  | 22 +++++++
 4 files changed, 111 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

-- 
2.44.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-22 20:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28 11:46 [PATCH bpf-next v3 0/2] bpf: Fix updating attached freplace prog to prog_array map Leon Hwang
2024-07-28 11:46 ` [PATCH bpf-next v3 1/2] " Leon Hwang
2024-07-29  2:25   ` Tengda Wu
2024-08-12 22:34   ` Alexei Starovoitov
2024-08-22  3:01     ` Leon Hwang
2024-08-22 20:36       ` Alexei Starovoitov
2024-07-28 11:46 ` [PATCH bpf-next v3 2/2] selftests/bpf: Add testcase for " Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox