lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzZ6xSc7cFy7rF=G2+gPAfK+5cvZ0eDhnd5eP5m1t9EK-A@mail.gmail.com>
Date: Thu, 4 Sep 2025 13:49:49 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Jiri Olsa <olsajiri@...il.com>, Oleg Nesterov <oleg@...hat.com>, 
	Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>, 
	open list <linux-kernel@...r.kernel.org>, 
	Linux trace kernel <linux-trace-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>, 
	Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>, 
	John Fastabend <john.fastabend@...il.com>, Hao Luo <haoluo@...gle.com>, 
	Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Alan Maguire <alan.maguire@...cle.com>, David Laight <David.Laight@...lab.com>, 
	Thomas Weißschuh <thomas@...ch.de>, 
	Ingo Molnar <mingo@...nel.org>
Subject: Re: nop5-optimized USDTs WAS: Re: [PATCHv6 perf/core 09/22]
 uprobes/x86: Add uprobe syscall to speed up uprobe

On Thu, Sep 4, 2025 at 1:35 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Thu, Sep 04, 2025 at 11:27:45AM -0700, Andrii Nakryiko wrote:
>
> > > > So I've been thinking what's the simplest and most reliable way to
> > > > feature-detect support for this sys_uprobe (e.g., for libbpf to know
> > > > whether we should attach at nop5 vs nop1), and clearly that would be
> > >
> > > wrt nop5/nop1.. so the idea is to have USDT macro emit both nop1,nop5
> > > and store some info about that in the usdt's elf note, right?
>
> Wait, what? You're doing to emit 6 bytes and two nops? Why? Surely the
> old kernel can INT3 on top of a NOP5?
>

Yes it can, but it's 2x slower in terms of uprobe triggering compared
to nop1. So while it will work to use just nop5 on old kernels, it's
going to be a performance regression if we do this unconditionally.

So the idea was to have nop1 + nop5, stick to nop1 for old kernels,
attach to nop5 for newer ones (that's where feature detection I was
asking about is important, libbpf will do this automatically and
transparently).

I know it's messy, but I think we have to do that.

>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ