From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org,
emil@etsalapatis.com, ihor.solodrai@linux.dev, shuah@kernel.org,
jakub@cloudflare.com, peterz@infradead.org,
phoenix500526@163.com, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, martin.lau@kernel.org,
clm@meta.com
Subject: Re: [PATCH bpf 1/2] libbpf: Fix usdt attach failure when nop10 crosses page boundary
Date: Mon, 24 Aug 2026 18:27:17 +0800 [thread overview]
Message-ID: <d485f3e8-e254-4bf8-8619-982df0e160fe@linux.dev> (raw)
In-Reply-To: <3cbe827e0809b8f8e521cac3f904986e6d885780838a4118da311f40e70b1c2b@mail.kernel.org>
On 8/24/26 6:03 PM, bot+bpf-ci@kernel.org wrote:
>> Fixes: 41a5c7df4466 ("libbpf: Add support to detect nop,nop5 instructions combo for usdt probe")
>> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> Does the Fixes tag point at the right commit? The -ENOTSUPP attach
> failure could not happen at 41a5c7df4466.
>
> At 41a5c7df4466 the uprobe was shifted onto a nop5 (0f 1f 44 00 00), and
> arch_uprobe_analyze_insn() ran uprobe_init_insn() unconditionally:
>
> ret = uprobe_init_insn(auprobe, &insn, is_64bit_mm(mm));
> if (ret)
> return ret;
> if (can_optimize(&insn, addr))
> set_bit(ARCH_UPROBE_FLAG_CAN_OPTIMIZE, &auprobe->flags);
>
> uprobe_init_insn() accepts nop5: is_prefix_bad() finds no prefix, and
> test_bit(OPCODE1 == 0x0f, good_insns_64) is set. So a nop5 that crossed
> a page boundary simply produced a normal, working int3 uprobe. The attach
> succeeded.
>
> The failure was introduced by the nop10 switch:
>
> 554ba38456da ("uprobes/x86: Move optimized uprobe from nop5 to nop10")
> made can_optimize() failure fall through to uprobe_init_insn(), and the
> nop10's 0x2e byte is a CS prefix that is_prefix_bad() rejects:
>
> if (can_optimize(&insn, addr)) {
> set_bit(ARCH_UPROBE_FLAG_CAN_OPTIMIZE, &auprobe->flags);
> } else {
> ret = uprobe_init_insn(auprobe, &insn);
> if (ret)
> return ret;
> }
>
> ee2862439e5c ("libbpf: Change has_nop_combo to work on top of nop10")
> made libbpf shift the uprobe onto that nop10.
>
> Should the tag be:
>
> Fixes: ee2862439e5c ("libbpf: Change has_nop_combo to work on top of nop10")
ee2862439e5c is correct.
Waiting for more feedback.
> This also matters for backport scope: a tree that has 41a5c7df4466 but
> not ee2862439e5c still matches the 6-byte nop,nop5 pattern, where the
> new hardcoded +10 in nop10_within_page() would be over-strict by 5 bytes
> while the bug being fixed does not exist there.
>
>
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/32712703327
next prev parent reply other threads:[~2026-08-24 10:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 9:28 [PATCH bpf 1/2] libbpf: Fix usdt attach failure when nop10 crosses page boundary Jiayuan Chen
2026-08-24 9:28 ` [PATCH bpf 2/2] selftests/bpf: Add test for usdt probe with page-crossing nop10 Jiayuan Chen
2026-08-24 10:03 ` bot+bpf-ci
2026-08-24 10:03 ` [PATCH bpf 1/2] libbpf: Fix usdt attach failure when nop10 crosses page boundary bot+bpf-ci
2026-08-24 10:27 ` Jiayuan Chen [this message]
2026-08-25 13:58 ` Jiri Olsa
2026-08-25 14:29 ` Jiayuan Chen
2026-08-25 18:32 ` Andrii Nakryiko
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=d485f3e8-e254-4bf8-8619-982df0e160fe@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jakub@cloudflare.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=peterz@infradead.org \
--cc=phoenix500526@163.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--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