[PATCH 02/13] Update PIDFD_* constants for Linux 6.17
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Thu Nov 20 14:08:37 GMT 2025
On 20/11/25 11:01, Florian Weimer wrote:
> * Yury Khrustalev:
>
>> On Fri, Nov 07, 2025 at 09:56:43AM +0000, Yury Khrustalev wrote:
>>> Hi,
>>>
>>> On Thu, Nov 06, 2025 at 04:30:15PM +0100, Adhemerval Zanella Netto wrote:
>>>>
>>>> On 06/11/25 15:59, Yury Khrustalev wrote:
>>>>> On Fri, Oct 03, 2025 at 04:38:53PM -0300, Adhemerval Zanella wrote:
>>>>>> The pidfd interface was extended with:
>>>>>>
>>>>>> ...
>>>>>
>>>>> The misc/tst-pidfd_getinfo test fails with
>>>>>
>>>>> error: ../sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c:52: ioctl (PIDFD_GET_INFO) failed: Invalid argument
>>>>>
>>>>> on aarch64 with kernel 6.12 and passes on a system with kernel 6.17 and 6.18.
>>>>
>>>> I had the impression ENOTTY was the error code in this case, on 6.1.0:
>>>>
>>>> $ strace -f misc/tst-pidfd_getinfo --direct
>>>> [...]
>>>> ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xff, 0xb, 0x48), 0x7ffe475d4670) = -1 ENOTTY (Inappropriate ioctl for device)
>>>> [...]
>>>>
>>>> If EINVAL is also a possible error we might need to also handle it.
>>>
>>> On system with 6.12 I get:
>>>
>>> $ strace -e trace=ioctl -ff ./misc/tst-pidfd_getinfo
>>> strace: Process 4177312 attached
>>> [pid 4177312] ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xff, 0xb, 0x48), 0xffffdda3a3a8) = -1 EINVAL (Invalid argument)
>>> error: ../sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c:52: ioctl (PIDFD_GET_INFO) failed: Invalid argument
>>> [pid 4177312] +++ exited with 1 +++
>>> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4177312, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
>>> error: 1 test failures
>>> +++ exited with 1 +++
>>>
>>> And on system with 6.17 I get:
>>>
>>> $ strace -e trace=ioctl -ff ./misc/tst-pidfd_getinfo
>>> strace: Process 5279 attached
>>> [pid 5279] ioctl(3, PIDFD_GET_INFO, 0xfffffffff308) = 0
>>> [pid 5279] +++ exited with 0 +++
>>> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5279, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
>>> +++ exited with 0 +++
>>>
>>> So, I think that the test should expect EINVAL for an unsupported flag,
>>> in which case the test should be UNSUPPORTED.
>>
>> Is there a BZ for this? I can send a patch with a fix if this helps.
>
> What would be the fix be?
>
> I think if the UAPI headers are wrong, the test should fail.
>
I think you mean the PIDFD_SELF_THREAD_GROUP here, and it was intentional
by the kernel developers [1].
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=33645#c4
More information about the Libc-alpha
mailing list