BPF List
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	toke@redhat.com, martin.lau@kernel.org, eddyz87@gmail.com,
	yonghong.song@linux.dev, wutengda@huaweicloud.com,
	leon.hwang@linux.dev, kernel-patches-bot@fb.com
Subject: [PATCH bpf-next v2 0/2] bpf: Fix updating attached freplace prog to prog_array map
Date: Fri, 26 Jul 2024 23:39:50 +0800	[thread overview]
Message-ID: <20240726153952.76914-1-leon.hwang@linux.dev> (raw)

The commit f7866c3587337731 ("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.

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.

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

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   | 25 +++++++
 .../testing/selftests/bpf/progs/tc_bpf2bpf.c  | 21 ++++++
 4 files changed, 112 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


             reply	other threads:[~2024-07-26 15:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26 15:39 Leon Hwang [this message]
2024-07-26 15:39 ` [PATCH bpf-next v2 1/2] bpf: Fix updating attached freplace prog to prog_array map Leon Hwang
2024-07-26 19:34   ` Yonghong Song
2024-07-26 15:39 ` [PATCH bpf-next v2 2/2] selftests/bpf: Add testcase for " Leon Hwang
2024-07-26 19:38   ` Yonghong Song
2024-07-27  3:28     ` Leon Hwang
2024-07-27  3:39       ` Yonghong Song
2024-07-26 19:26 ` [PATCH bpf-next v2 0/2] bpf: Fix " Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240726153952.76914-1-leon.hwang@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-patches-bot@fb.com \
    --cc=martin.lau@kernel.org \
    --cc=toke@redhat.com \
    --cc=wutengda@huaweicloud.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox