public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Palmer Dabbelt <palmer@dabbelt.com>, Guo Ren <guoren@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Kees Cook <kees@kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"H.J. Lu" <hjl.tools@gmail.com>,
	Sohil Mehta <sohil.mehta@intel.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: Re: [RFC] uretprobe: change syscall number, again
Date: Fri, 2 Aug 2024 13:52:13 +0200	[thread overview]
Message-ID: <ZqzIbU_T6sN01o5B@krava> (raw)
In-Reply-To: <20240802181437.29b439e26608561f1289892a@kernel.org>

On Fri, Aug 02, 2024 at 06:14:37PM +0900, Masami Hiramatsu wrote:
> On Tue, 30 Jul 2024 17:43:36 +0200
> Arnd Bergmann <arnd@kernel.org> wrote:
> 
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > Despite multiple attempts to get the syscall number assignment right
> > for the newly added uretprobe syscall, we ended up with a bit of a mess:
> > 
> >  - The number is defined as 467 based on the assumption that the
> >    xattrat family of syscalls would use 463 through 466, but those
> >    did not make it into 6.11.
> 
> OK... that was not expected.
> 
> > 
> >  - The include/uapi/asm-generic/unistd.h file still lists the number
> >    463, but the new scripts/syscall.tbl that was supposed to have the
> >    same data lists 467 instead as the number for arc, arm64, csky,
> >    hexagon, loongarch, nios2, openrisc and riscv. None of these
> >    architectures actually provide a uretprobe syscall.
> 
> Oops, thanks for finding.
> 
> > 
> >  - All the other architectures (powerpc, arm, mips, ...) don't list
> >    this syscall at all.
> 
> OK, so even if it is not supported on those, we need to put it as a
> placeholder.
> 
> > 
> > There are two ways to make it consistent again: either list it with
> > the same syscall number on all architectures, or only list it on x86
> > but not in scripts/syscall.tbl and asm-generic/unistd.h.
> > 
> > Based on the most recent discussion, it seems like we won't need it
> > anywhere else, so just remove the inconsistent assignment and instead
> > move the x86 number to the next available one in the architecture
> > specific range, which is 335.
> > 
> > Fixes: 5c28424e9a34 ("syscalls: Fix to add sys_uretprobe to syscall.tbl")
> > Fixes: 190fec72df4a ("uprobe: Wire up uretprobe system call")
> > Fixes: 63ded110979b ("uprobe: Change uretprobe syscall scope and number")
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > I think we should fix this as soon as possible. Please let me know if
> > you agree on this approach, or prefer one of the alternatives.
> 
> OK, I think it is good. But you missed to fix a selftest code which
> also needs to be updated.
> 
> Could you revert commit 3e301b431b91 ("selftests/bpf: Change uretprobe
>  syscall number in uprobe_syscall test") too?
> 
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Thank you,

yes, it still needs the selftest change like below
otherwise if that new number works for you then lgtm

Reviewed-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka


---
diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
index bd8c75b620c2..5f78edca6540 100644
--- a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
+++ b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
@@ -216,7 +216,7 @@ static void test_uretprobe_regs_change(void)
 }
 
 #ifndef __NR_uretprobe
-#define __NR_uretprobe 467
+#define __NR_uretprobe 335
 #endif
 
 __naked unsigned long uretprobe_syscall_call_1(void)

  reply	other threads:[~2024-08-02 11:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 15:43 [RFC] uretprobe: change syscall number, again Arnd Bergmann
2024-08-02  9:14 ` Masami Hiramatsu
2024-08-02 11:52   ` Jiri Olsa [this message]
2024-08-02 13:18   ` Arnd Bergmann
2024-08-02 14:00     ` Masami Hiramatsu

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=ZqzIbU_T6sN01o5B@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=guoren@kernel.org \
    --cc=hjl.tools@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kees@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=luto@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=peterz@infradead.org \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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