|
@@ -378,6 +378,7 @@ alternative_insn eret, nop, ARM64_UNMAP_KERNEL_AT_EL0
|
|
* x7 is reserved for the system call number in 32-bit mode.
|
|
* x7 is reserved for the system call number in 32-bit mode.
|
|
*/
|
|
*/
|
|
wsc_nr .req w25 // number of system calls
|
|
wsc_nr .req w25 // number of system calls
|
|
|
|
+xsc_nr .req x25 // number of system calls (zero-extended)
|
|
wscno .req w26 // syscall number
|
|
wscno .req w26 // syscall number
|
|
xscno .req x26 // syscall number (zero-extended)
|
|
xscno .req x26 // syscall number (zero-extended)
|
|
stbl .req x27 // syscall table pointer
|
|
stbl .req x27 // syscall table pointer
|
|
@@ -935,6 +936,7 @@ el0_svc_naked: // compat entry point
|
|
b.ne __sys_trace
|
|
b.ne __sys_trace
|
|
cmp wscno, wsc_nr // check upper syscall limit
|
|
cmp wscno, wsc_nr // check upper syscall limit
|
|
b.hs ni_sys
|
|
b.hs ni_sys
|
|
|
|
+ mask_nospec64 xscno, xsc_nr, x19 // enforce bounds for syscall number
|
|
ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
|
|
ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
|
|
blr x16 // call sys_* routine
|
|
blr x16 // call sys_* routine
|
|
b ret_fast_syscall
|
|
b ret_fast_syscall
|