public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Shuah Khan <shuah@kernel.org>, Feng Yang <yangfeng@kylinos.cn>,
	Toke Hoiland-Jorgensen <toke@redhat.com>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kernel-patches-bot@fb.com
Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Add test to verify the fix of kprobe_write_ctx abuse
Date: Mon, 30 Mar 2026 21:55:02 +0800	[thread overview]
Message-ID: <cd12a2fc-8fc4-40ab-a5bc-bf7b0f4ce766@linux.dev> (raw)
In-Reply-To: <acpCWX6h-1IJtorN@krava>

On 2026/3/30 17:28, Jiri Olsa wrote:
> On Thu, Mar 26, 2026 at 10:17:18PM +0800, Leon Hwang wrote:
> 
> SNIP
> 
>> +	prog_fd = bpf_program__fd(skel_kprobe->progs.kprobe_write_ctx);
>> +	bpf_program__set_attach_target(prog_ext, prog_fd, "kprobe_write_ctx");
>> +
>> +	err = kprobe_write_ctx__load(skel_ext);
>> +	if (!ASSERT_OK(err, "kprobe_write_ctx__load ext"))
>> +		goto out;
>> +
>> +	prog_fd = bpf_program__fd(prog_kprobe);
>> +	link_ext = bpf_program__attach_freplace(prog_ext, prog_fd, "kprobe_dummy");
>> +	ASSERT_ERR_PTR(link_ext, "bpf_program__attach_freplace link");
>> +	ASSERT_EQ(errno, EINVAL, "bpf_program__attach_freplace errno");
> 
> nit, I prefer libbpf_get_error call instead, because it's not obvious
> that ASSERT_ERR_PTR sets errno, smth like:
> 
>         if (!ASSERT_EQ(libbpf_get_error(link_ext), -EINVAL, ..
> 

Yeah, libbpf_get_error() is better. Will use it.

> anyway lgtm
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> 

Thanks for your review.

Thanks,
Leon

[...]


      reply	other threads:[~2026-03-30 13:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 14:17 [PATCH bpf-next v2 0/2] bpf: Fix abuse of kprobe_write_ctx via freplace Leon Hwang
2026-03-26 14:17 ` [PATCH bpf-next v2 1/2] " Leon Hwang
2026-03-27 21:39   ` Song Liu
2026-03-30  5:38     ` Leon Hwang
2026-03-30 16:43       ` Song Liu
2026-03-30 17:09         ` Alexei Starovoitov
2026-03-30 17:20           ` Song Liu
2026-03-30  9:28   ` Jiri Olsa
2026-03-30 13:52     ` Leon Hwang
2026-03-26 14:17 ` [PATCH bpf-next v2 2/2] selftests/bpf: Add test to verify the fix of kprobe_write_ctx abuse Leon Hwang
2026-03-30  9:28   ` Jiri Olsa
2026-03-30 13:55     ` Leon Hwang [this message]

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=cd12a2fc-8fc4-40ab-a5bc-bf7b0f4ce766@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=john.fastabend@gmail.com \
    --cc=kernel-patches-bot@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=olsajiri@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=toke@redhat.com \
    --cc=yangfeng@kylinos.cn \
    --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