Commit 8fa136d9 authored by Wayne Ren's avatar Wayne Ren Committed by David Leach
Browse files

arch: arc: fix the bug of blt in syscall

blt is signed comparsion, if r6 is a negative number created by
malicious code, it will pass the check, bring a secure risk.

use blo (unsinged comparison) to do the check.

Signed-off-by: default avatarWayne Ren <wei.ren@synopsys.com>
Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 9d3186c4
Loading
Loading
Loading
Loading
+1 −1
Changes for arch/arc/core/fault_s.S: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ SECTION_SUBSEC_FUNC(TEXT,__fault,__ev_trap)
	/* do sys_call */
	mov_s ilink, K_SYSCALL_LIMIT
	cmp r6, ilink
	blt valid_syscall_id
	blo valid_syscall_id

	mov_s r0, r6
	mov_s r6, K_SYSCALL_BAD