From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Andrii Nakryiko <andrii@kernel.org>,
linux-trace-kernel@vger.kernel.org, rostedt@goodmis.org,
mhiramat@kernel.org, x86@kernel.org, mingo@redhat.com,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, rihams@fb.com,
linux-perf-users@vger.kernel.org, rick.p.edgecombe@intel.com
Subject: Re: [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe
Date: Wed, 10 Jul 2024 09:24:51 -0700 [thread overview]
Message-ID: <20240710162311.gz3njyjshraeuto7@treble> (raw)
In-Reply-To: <CAEf4BzZFU6CEK-=eTo_LTScYCVoBCYXeH_O_AoZd8rBYiwWzdg@mail.gmail.com>
On Wed, Jul 10, 2024 at 08:11:57AM -0700, Andrii Nakryiko wrote:
> On Wed, Jul 10, 2024 at 4:39 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > On Tue, Jul 09, 2024 at 10:50:00AM -0700, Andrii Nakryiko wrote:
> > > You can see it replaced the first byte, the following 3 bytes are
> > > remnants of endb64 (gdb says it's a nop? :)), and then we proceeded,
> > > you can see I stepped through a few more instructions.
> > >
> > > Works by accident?
> >
> > Yeah, we don't actually have Userspace IBT enabled yet, even on hardware
> > that supports it.
>
> OK, I don't know what the implications are, but it's a good accident :)
>
> Anyways, what should I do for v4? Drop is_endbr6() check or keep it?
Given the current behavior of uprobe overwriting ENDBR64 with INT3, the
is_endbr6() check still makes sense, otherwise is_uprobe_at_func_entry()
would never return true on OSes which have the ENDBR64 compiled in.
However, once userspace IBT actually gets enabled, uprobe should skip
the ENDBR64 and patch the subsequent instruction. Then the is_endbr6()
check would no longer be needed.
--
Josh
next prev parent reply other threads:[~2024-07-10 16:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 23:11 [PATCH v4] perf,x86: avoid missing caller address in stack traces captured in uprobe Andrii Nakryiko
2024-07-09 10:11 ` Peter Zijlstra
2024-07-09 14:10 ` Masami Hiramatsu
2024-07-09 15:24 ` Peter Zijlstra
2024-07-09 17:50 ` Andrii Nakryiko
2024-07-10 11:38 ` Peter Zijlstra
2024-07-10 15:11 ` Andrii Nakryiko
2024-07-10 16:24 ` Josh Poimboeuf [this message]
2024-07-10 19:24 ` 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=20240710162311.gz3njyjshraeuto7@treble \
--to=jpoimboe@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=rihams@fb.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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