Files
Ryan El Kochta f9d533b8ce SO_PEERCRED: fix race against thread-group reap
NewSCMCredentials previously resolved the specified PID into a thread group with separate calls to ThreadGroupWithID() and PIDNamespacedIDs().
Both of these functions separately take and release the TaskSet lock.

This causes a race condition where between the two function calls, the thread group might get reaped, leading to the panic() being reached.

This commit addresses this issue by moving the thread group resolution/PID namespace map creation into a single critical section.
A regression syscall test is also included.

Reported-by: [email protected]
2026-07-31 09:31:46 -07:00
..