Re: [RFC v2 PATCH 7/7] x86/entry: use int for syscall number; handle all invalid syscall nrs

From: Thomas Gleixner
Date: Wed May 12 2021 - 16:02:41 EST


On Wed, May 12 2021 at 11:21, H. Peter Anvin wrote:
> On 5/12/21 5:09 AM, Thomas Gleixner wrote:
>>
>>> index 1d9db15fdc69..85f04ea0e368 100644
>>> --- a/arch/x86/entry/entry_64.S
>>> +++ b/arch/x86/entry/entry_64.S
>>> @@ -108,7 +108,7 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)
>>>
>>> /* IRQs are off. */
>>> movq %rsp, %rdi
>>> - movq %rax, %rsi
>>> + movslq %eax, %rsi
>>
>> This is wrong.
>>
>> syscall(long number,...);
>>
>> So the above turns syscall(UINT_MAX + N, ...) into syscall(N, ...).
>>
>
> That is intentional, as (again) system calls are int.

They are 'int' kernel internally, but _NOT_ at the user space visible
side. Again: man syscall

syscall(long number,...);

So that results in a user ABI change.

> As stated in my reply to Ingo, I'll clean the various descriptions and
> try to capture the discussion better.

If we agree to go there then this wants to be a seperate commit which
does nothing else than changing this behaviour.

Thanks,

tglx