Skip to content

Commit 54233a4

Browse files
committed
uretprobe: change syscall number, again
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. - 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. - All the other architectures (powerpc, arm, mips, ...) don't list this syscall at all. 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: 5c28424 ("syscalls: Fix to add sys_uretprobe to syscall.tbl") Fixes: 190fec7 ("uprobe: Wire up uretprobe system call") Fixes: 63ded11 ("uprobe: Change uretprobe syscall scope and number") Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent b07ce24 commit 54233a4

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

arch/x86/entry/syscalls/syscall_64.tbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@
344344
332 common statx sys_statx
345345
333 common io_pgetevents sys_io_pgetevents
346346
334 common rseq sys_rseq
347+
335 common uretprobe sys_uretprobe
347348
# don't use numbers 387 through 423, add new calls after the last
348349
# 'common' entry
349350
424 common pidfd_send_signal sys_pidfd_send_signal
@@ -385,7 +386,6 @@
385386
460 common lsm_set_self_attr sys_lsm_set_self_attr
386387
461 common lsm_list_modules sys_lsm_list_modules
387388
462 common mseal sys_mseal
388-
467 common uretprobe sys_uretprobe
389389

390390
#
391391
# Due to a historical design error, certain syscalls are numbered differently

include/uapi/asm-generic/unistd.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,8 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
841841
#define __NR_mseal 462
842842
__SYSCALL(__NR_mseal, sys_mseal)
843843

844-
#define __NR_uretprobe 463
845-
__SYSCALL(__NR_uretprobe, sys_uretprobe)
846-
847844
#undef __NR_syscalls
848-
#define __NR_syscalls 464
845+
#define __NR_syscalls 463
849846

850847
/*
851848
* 32 bit systems traditionally used different

scripts/syscall.tbl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,3 @@
402402
460 common lsm_set_self_attr sys_lsm_set_self_attr
403403
461 common lsm_list_modules sys_lsm_list_modules
404404
462 common mseal sys_mseal
405-
467 common uretprobe sys_uretprobe

tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static void test_uretprobe_regs_change(void)
216216
}
217217

218218
#ifndef __NR_uretprobe
219-
#define __NR_uretprobe 467
219+
#define __NR_uretprobe 335
220220
#endif
221221

222222
__naked unsigned long uretprobe_syscall_call_1(void)

0 commit comments

Comments
 (0)