Skip to content

Commit de09c93

Browse files
Wayne Rennashif
authored andcommitted
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: Wayne Ren <[email protected]> Signed-off-by: David Brown <[email protected]>
1 parent dae2e71 commit de09c93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arc/core/fault_s.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ SECTION_SUBSEC_FUNC(TEXT,__fault,__ev_trap)
156156
/* do sys_call */
157157
mov ilink, K_SYSCALL_LIMIT
158158
cmp r6, ilink
159-
blt valid_syscall_id
159+
blo valid_syscall_id
160160

161161
mov r0, r6
162162
mov r6, K_SYSCALL_BAD

0 commit comments

Comments
 (0)