[PATCH 0/3] Linux: Keep termios ioctl constants strictly internal

H. Peter Anvin hpa@zytor.com
Tue Jul 15 15:44:22 GMT 2025


On July 15, 2025 8:23:17 AM PDT, Andreas Schwab <schwab@suse.de> wrote:
>On Jul 15 2025, H. Peter Anvin wrote:
>
>> On July 15, 2025 12:39:06 AM PDT, Andreas Schwab <schwab@suse.de> wrote:
>>>On Jul 14 2025, H. Peter Anvin wrote:
>>>
>>>> When this was first discussed I suggested that the Right Thing for the
>>>> sanitizer to do is to use <linux/ioctl.h> and <linux/termios.h> instead of
>>>> <sys/ioctl.h> and <termios.h>, because what the sanitizer is looking for
>>>> (in this case) is specifically the kernel ABIs.
>>>
>>>But the sanitizer intercepts libc, not syscalls.
>>>
>>
>> It does, but ioctl(3) is basically ioctl(2), much like intercepting syscall(3).
>
>Since it intercepts the libc wrapper, it needs to use the ioctl numbers
>that libc uses.
>

There are exactly four ioctls intercepted by Linux glibc, and only on the PowerPC platform. The error of using the libc headers is vastly higher than the converse would be.


More information about the Libc-alpha mailing list