Skip to content
Snippets Groups Projects
Commit 04a8a3d0 authored by Michael Karcher's avatar Michael Karcher Committed by Rich Felker
Browse files

sh: Fix validation of system call number


The slow path for traced system call entries accessed a wrong memory
location to get the number of the maximum allowed system call number.
Renumber the numbered "local" label for the correct location to avoid
collisions with actual local labels.

Signed-off-by: default avatarMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Tested-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Fixes: f3a83088 ("sh: Add a few missing irqflags tracing markers.")
Signed-off-by: default avatarRich Felker <dalias@libc.org>
parent c7bcbc8a
No related branches found
No related tags found
No related merge requests found
...@@ -199,7 +199,7 @@ syscall_trace_entry: ...@@ -199,7 +199,7 @@ syscall_trace_entry:
mov.l @(OFF_R7,r15), r7 ! arg3 mov.l @(OFF_R7,r15), r7 ! arg3
mov.l @(OFF_R3,r15), r3 ! syscall_nr mov.l @(OFF_R3,r15), r3 ! syscall_nr
! !
mov.l 2f, r10 ! Number of syscalls mov.l 6f, r10 ! Number of syscalls
cmp/hs r10, r3 cmp/hs r10, r3
bf syscall_call bf syscall_call
mov #-ENOSYS, r0 mov #-ENOSYS, r0
...@@ -353,7 +353,7 @@ ENTRY(system_call) ...@@ -353,7 +353,7 @@ ENTRY(system_call)
tst r9, r8 tst r9, r8
bf syscall_trace_entry bf syscall_trace_entry
! !
mov.l 2f, r8 ! Number of syscalls mov.l 6f, r8 ! Number of syscalls
cmp/hs r8, r3 cmp/hs r8, r3
bt syscall_badsys bt syscall_badsys
! !
...@@ -392,7 +392,7 @@ syscall_exit: ...@@ -392,7 +392,7 @@ syscall_exit:
#if !defined(CONFIG_CPU_SH2) #if !defined(CONFIG_CPU_SH2)
1: .long TRA 1: .long TRA
#endif #endif
2: .long NR_syscalls 6: .long NR_syscalls
3: .long sys_call_table 3: .long sys_call_table
7: .long do_syscall_trace_enter 7: .long do_syscall_trace_enter
8: .long do_syscall_trace_leave 8: .long do_syscall_trace_leave
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment