[PATCH v6 3/3] nptl: Use direct syscall numbers in setxid
Florian Weimer
fweimer@redhat.com
Fri Apr 28 10:52:47 GMT 2023
* Szabolcs Nagy via Libc-alpha:
> The 04/24/2023 23:17, Xi Ruoyao via Libc-alpha wrote:
>> On Mon, 2023-04-24 at 11:03 -0400, Joe Simmons-Talbott via Libc-alpha
>> wrote:
>> > Make all internal glibc syscalls use direct compile time numeric values
>> > rather than variables. This will make the syscall number easier to
>> > identify during static analysis.
>>
>> This is making the code much more bloated and slower. Do we really want
>> to make everyone's system slower for some debug tools?
>
> the switch statement overhead is many orders of magnitude smaller
> than sending a signal to a thread and executing a syscall there
> (which is where the switch statement happens).
>
> i dont know if the change is justified, but from a target port
> perspective it's useful if inline syscalls are guaranteed to use
> a syscall name that can expand to an integer constant or named
> function.
If the only place we have dynamic system calls in glibc is the syscall
function, we can add a check there to block system calls using it unless
the symbol has been bound before. Together with BTI/IBT, this would
prevent issuing arbitrary system calls using machine code fragments from
glibc.
Not sure if that is important consideration. If it does not matter, we
could change the pthread code to call an internal alias of the syscall
function instead.
Thanks,
Florian
More information about the Libc-alpha
mailing list