{"id":"CVE-2026-99839","summary":"pidfs: don't let PIDFD_GET_INFO miss a reaped task","details":"In the Linux kernel, the following vulnerability has been resolved:\n\npidfs: don't let PIDFD_GET_INFO miss a reaped task\n\nPIDFD_GET_INFO describes the task while there is one, and with\nPIDFD_INFO_EXIT its exit status once it has been reaped.  pidfd_info()\nlooks at the two in the wrong order and can miss both:\n\n  pidfd_info()                          release_task()\n    PIDFS_ATTR_BIT_EXIT is not set\n                                          pidfs_exit()\n                                          __unhash_process()\n    get_pid_task() == NULL\n    goto copy_out\n\nThe ioctl succeeds with neither PIDFD_INFO_PID nor PIDFD_INFO_EXIT in the\nmask.  If the task is unhashed a little later, after get_pid_task(), its\npid reads as 0 and the ioctl fails with -ESRCH, although the caller asked\nfor the exit information and it is available by now.\n\nThe second case does not even need an exit.  When a sub-thread execs,\nde_thread() hands the leader's pid over to it and releases the old leader.\nA caller that got hold of the old leader reports the tid of the sub-thread\nas the pid, or -ESRCH for a process that is alive.\n\nLook up the task first.  pidfs_exit() runs before the task is unhashed, so\na caller that finds no task finds the exit information; this needs a\nbarrier on both sides because taking tasklist_lock does not order the\nstore in pidfs_exit() against the one in detach_pid().  And start over if\nthe task no longer owns the pid when all the fields have been read: then\nthere is either exit information or another task.\n\nGo by the pid for that check and for the pid we report, not by\n-\u003ethread_pid of the task.  exchange_tids() moves the pid to the exec'ing\nthread before it updates -\u003ethread_pid of either task.  A caller that\nfinds the new leader in between would read the old tid of the sub-thread\nfrom -\u003ethread_pid, and a check of -\u003ethread_pid would restart until the\nexec'ing thread gets to its store.  On PREEMPT_RT that thread can be\npreempted with tasklist_lock held and can't move to another CPU.  If the\nRT task that preempted it calls PIDFD_GET_INFO, the ioctl spins until\nthe exec'ing thread gets the CPU back, and that never happens if the\nexec'ing thread is an RT task of lower priority.\n\nChristian Brauner \u003cbrauner@kernel.org\u003e says:\n\nGo by @pid instead of -\u003ethread_pid of the task for the reported pid and\nfor the restart check.","modified":"2026-11-30T15:02:31.893588436Z","published":"2026-11-30T13:17:31.955Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99839.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/172658cf600904ff6121e240f69a0ccb36e65d6b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/53d02e55c115dbe5ee455292009132713fbbd6f2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/830ff89b391e561b16e195bb2d92fded2d8c0456"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99839.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99839"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"cdda1f26e74bac732eca537a69f19f6a37b641be"},{"fixed":"53d02e55c115dbe5ee455292009132713fbbd6f2"},{"fixed":"830ff89b391e561b16e195bb2d92fded2d8c0456"},{"fixed":"172658cf600904ff6121e240f69a0ccb36e65d6b"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99839.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.65"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99839.json"}}],"schema_version":"1.9.2"}