CVE-2026-97903: exit: hold a reference to thread_pid across proc_flush_pid

Published Sep 25, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

exit: hold a reference to threadpid across procflushpid

Commit 0a36bad01731 ("releasetask: kill the no longer needed get/putpid(threadpid)") removed the reference around procflushpid(). It assumed that freepids(post.pids) at the end of releasetask() would keep threadpid alive until then.

That assumption is wrong. changepid() only records a detached PID in post.pids when pidhastask() is false for every PIDTYPE. If another task still uses the exiting task's PID as its process group or session ID, unhashprocess() removes the exiting task's PIDTYPEPID link but leaves the PID out of post.pids. releasetask() therefore holds no reference to it after dropping tasklistlock.

The other task can then remove the remaining PIDTYPE links. Its freepids() call schedules delayedputpid(), and the RCU callback can free the PID before the first releasetask() reaches procflushpid().

An unprivileged reproducer races wait4(-1) against setsid() to trigger this ordering. Three of three fresh v7.2 KASAN boots reported:

BUG: KASAN: slab-use-after-free in procinvalidatesiblingsdcache+0x3e2/0x3f0 Read of size 8 by task h7pidreaper/1921

Call Trace: procinvalidatesiblingsdcache releasetask waitconsidertask dowait dowait kernelwait4

Freed by task 0: kmemcachefree putpid delayedputpid rcucore

Last potentially related work creation: callrcucommon freepids ksyssetsid

KASAN identified a 144-byte object from the pid cache and located the bad read 80 bytes into the freed object, matching pid->inodes. With an explicit reference, three of three fresh boots completed without a KASAN report. The concurrent RCU callback dropped its reference while procflushpid() was protected, and the balancing putpid() performed the final free afterward.

Take a reference before unhashprocess() clears p->threadpid and release it after procflushpid() completes.

A tested source reproducer is available privately on request. No controlled read or write, information leak, or privilege escalation is claimed. The mainline patch applies directly to v6.19.y and newer; v6.16.y through v6.18.y need a context-adjusted backport.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Linux kernel to a version that resolves this vulnerability.

    Fixed in v6.19.y

Event History

Sep 25, 2026
CVE Published
via MITRE·10:22 AM
Data Sourced
via MITRE·10:22 AM
Description
Data Sourced
via NVD·11:17 AM
DescriptionSeverity

Frequently Asked Questions

1

What level of access is needed to trigger this issue?

The provided reproducer is unprivileged. It races wait4(-1) against setsid() to create the affected PID lifetime ordering.

2

How might this issue appear during testing or diagnostics?

KASAN can report a slab use-after-free in proc_invalidate_siblings_dcache. The report describes a read of size 8 after the PID object may have been freed through a delayed RCU callback.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203