From 502b67cebad02ebf8d8533baf2ee3250db00b46a Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 6 Mar 2020 16:06:08 +0100 Subject: [PATCH] arch: arm: aarch32: 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 --- arch/arm/core/aarch32/swap_helper.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/core/aarch32/swap_helper.S b/arch/arm/core/aarch32/swap_helper.S index a7642e94faf..329aece0baf 100644 --- a/arch/arm/core/aarch32/swap_helper.S +++ b/arch/arm/core/aarch32/swap_helper.S @@ -508,7 +508,10 @@ _do_syscall: ldr ip, =K_SYSCALL_LIMIT cmp r6, ip #endif - blt valid_syscall_id + /* The supplied syscall_id must be lower than the limit + * (Requires unsigned integer comparison) + */ + blo valid_syscall_id /* bad syscall id. Set arg1 to bad id and set call_id to SYSCALL_BAD */ str r6, [r0]