All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "David Windsor" <dwindsor@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] uprobes/x86: Recognize user ENDBR64 without kernel IBT
Date: Mon, 30 Nov 2026 12:27:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-241052@kernel.org> (raw)
In-Reply-To: <20261130122035.1586780-1-dwindsor@gmail.com>

> When a uprobe is placed at the start of a function, the prologue has not
> run yet and the return address is still at *regs->sp. To capture the
> caller, the unwinder checks is_uprobe_at_func_entry(), which looks at
> the probed instruction for a push %rbp or an endbr64.
> 
> The endbr64 check uses is_endbr(). On a kernel built without
> CONFIG_X86_KERNEL_IBT that is a stub returning false, so a uprobe on a
> function starting with endbr64 is not treated as a function entry and
> the caller is missing from the stack trace. Most binaries start their
> functions with endbr64 since -fcf-protection=branch is on by default.
> 
> Whether the user binary contains endbr64 has nothing to do with whether
> the kernel was built with IBT. Compare the probed instruction against
> gen_endbr() instead, and move gen_endbr() out of the HAS_KERNEL_IBT
> block so it is available without kernel IBT. is_endbr() is unchanged.
> 
> Fixes: cfa7f3d2c526 ("perf,x86: avoid missing caller address in stack traces captured in uprobe")
> Signed-off-by: David Windsor <dwindsor@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130122035.1586780-1-dwindsor@gmail.com?part=1

  reply	other threads:[~2026-11-30 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:20 [PATCH] uprobes/x86: Recognize user ENDBR64 without kernel IBT David Windsor
2026-11-30 12:27 ` sashiko-bot [this message]
2026-11-30 20:53 ` Masami Hiramatsu (Google)
2026-12-01 20:40 ` Andrii Nakryiko
2026-12-01 21:18   ` David Windsor

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=sashiko-outbox-241052@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dwindsor@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.