Skip to content

Commit 6da1361

Browse files
ioannisgnashif
authored andcommitted
arch: arm: userspace: fix syscall ID validation
We need an unsigned comparison when evaluating whether the supplied syscall ID is lower than the syscall ID limit. Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent 83bd7d3 commit 6da1361

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm/core/swap_helper.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ _do_syscall:
411411
/* validate syscall limit */
412412
ldr ip, =K_SYSCALL_LIMIT
413413
cmp r6, ip
414-
blt valid_syscall_id
414+
/* The supplied syscall_id must be lower than the limit
415+
* (Requires unsigned integer comparison)
416+
*/
417+
blo valid_syscall_id
415418

416419
/* bad syscall id. Set arg1 to bad id and set call_id to SYSCALL_BAD */
417420
str r6, [r0, #0]

0 commit comments

Comments
 (0)