From: bot+bpf-ci@kernel.org
To: hang.zhengyang1010@gmail.com,mhiramat@kernel.org,oleg@redhat.com,peterz@infradead.org,tglx@kernel.org,mingo@redhat.com,bp@alien8.de,dave.hansen@linux.intel.com,x86@kernel.org,hpa@zytor.com
Cc: linux-kernel@vger.kernel.org,linux-trace-kernel@vger.kernel.org,bpf@vger.kernel.org,andrii@kernel.org,jolsa@kernel.org,hang.zhengyang1010@gmail.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH] uprobes/x86: Emulate ENDBR as a NOP
Date: Fri, 13 Nov 2026 02:51:48 +0000 (UTC) [thread overview]
Message-ID: <b06f05b8fcb5ab7b943d4471968e02ac1667b73566c88e653bf18e1e97c35d0c@mail.kernel.org> (raw)
In-Reply-To: <20261112-uprobe-endbr-v1-1-284a47a5ae3e@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]
> uprobes/x86: Emulate ENDBR as a NOP
TL;DR: Design question: Peter Zijlstra objected on v1 that probing ENDBR would
cause #CP on indirect calls if userspace IBT arrives; the author agreed to
drop it, yet the patch still emulates ENDBR as a NOP.
> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
> --- a/arch/x86/kernel/uprobes.c
> +++ b/arch/x86/kernel/uprobes.c
[ ... ]
> +/*
> + * ENDBR64/ENDBR32 (f3 0f 1e fa/fb). Userspace IBT is not supported, so
> + * in a user task they are NOPs, and they start most functions in
> + * binaries built with -fcf-protection. Revisit if userspace IBT is
> + * ever enabled.
> + */
> +static bool insn_is_endbr(struct insn *insn)
> +{
> + return insn->length == 4 &&
> + insn->prefixes.nbytes == 1 && insn->prefixes.bytes[0] == 0xf3 &&
> + insn->opcode.nbytes == 2 && insn->opcode.bytes[0] == 0x0f &&
> + insn->opcode.bytes[1] == 0x1e &&
> + (insn->modrm.bytes[0] & ~1) == 0xfa;
> +}
> +
> /* Returns -ENOSYS if branch_xol_ops doesn't handle this insn */
> static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
> {
> u8 opc1 = OPCODE1(insn);
> insn_byte_t p;
>
> - if (insn_is_nop(insn))
> + if (insn_is_nop(insn) || insn_is_endbr(insn))
> goto setup;
Peter Zijlstra objected to this approach on the v1 thread:
Uh, no. We must not allow uprobe on ENDBR. If we ever get userspace
IBT (people are actually looking at that), then putting a probe on it
will make indirect function calls #CP.
Has that objection been addressed? The thread indicates the author agreed
and planned to drop the patch, yet this commit still emulates ENDBR as a
NOP in branch_setup_xol_ops().
Link: https://lore.kernel.org/all/20261112080406.GA2668804@noisy.programming.kicks-ass.net/
---
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/43353937212
prev parent reply other threads:[~2026-11-13 2:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 5:26 Hang Zhengyang via B4 Relay
2026-11-12 8:04 ` Peter Zijlstra
2026-11-12 8:16 ` Hang Zhengyang
2026-11-13 2:51 ` bot+bpf-ci [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=b06f05b8fcb5ab7b943d4471968e02ac1667b73566c88e653bf18e1e97c35d0c@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bp@alien8.de \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dave.hansen@linux.intel.com \
--cc=eddyz87@gmail.com \
--cc=hang.zhengyang1010@gmail.com \
--cc=hpa@zytor.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=mason@kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=x86@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
all inboxes | Powered by JetHome®