Merge tag 'core-entry-2024-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / kernel / entry / common.c
index 88cb3c8..90843cc 100644 (file)
@@ -57,8 +57,14 @@ long syscall_trace_enter(struct pt_regs *regs, long syscall,
        /* Either of the above might have changed the syscall number */
        syscall = syscall_get_nr(current, regs);
 
-       if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT))
+       if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT)) {
                trace_sys_enter(regs, syscall);
+               /*
+                * Probes or BPF hooks in the tracepoint may have changed the
+                * system call number as well.
+                */
+               syscall = syscall_get_nr(current, regs);
+       }
 
        syscall_enter_audit(regs, syscall);