From 6da1361c71a1bf1d1b7108ec56b91163f4e259d8 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Tue, 17 Mar 2020 19:00:46 +0100 Subject: [PATCH] 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 --- arch/arm/core/swap_helper.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/core/swap_helper.S b/arch/arm/core/swap_helper.S index 696fc8148d2847..7c0c2a0cb1cd82 100644 --- a/arch/arm/core/swap_helper.S +++ b/arch/arm/core/swap_helper.S @@ -411,7 +411,10 @@ _do_syscall: /* validate syscall limit */ ldr ip, =K_SYSCALL_LIMIT cmp r6, ip - 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, #0]