lkml.org 
[lkml]   [2021]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ARC: entry: fix off-by-one error in syscall number validation
Date
On 4/29/21 4:39 AM, Shahab Vahedi wrote:
> On 4/23/21 9:52 PM, Vineet Gupta wrote:
>> diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
>> index 1743506081da..aea9b558993d 100644
>> --- a/arch/arc/kernel/entry.S
>> +++ b/arch/arc/kernel/entry.S
>> @@ -255,7 +255,7 @@ ENTRY(EV_Trap)
>> ;============ Normal syscall case
>>
>> ; syscall num shd not exceed the total system calls avail
>> - cmp r8, NR_syscalls
>> + cmp r8, NR_syscalls - 1
>> mov.hi r0, -ENOSYS
>> bhi .Lret_from_system_call
> Same problem exists in "syscall Tracing" section:
>
> ; Do the Sys Call as we normally would.
> ; Validate the Sys Call number
> cmp r8, NR_syscalls
> mov.hi r0, -ENOSYS
> bhi tracesys_exit

Thanks for spotting this. I'll fix this up and repush (after the ongoing
merge window).

-Vineet
\
 
 \ /
  Last update: 2021-04-29 20:18    [W:0.082 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site