net: kcm: Fix race condition in kcm_unattach()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: kcm: Fix race condition in kcm_unattach()
syzbot found a race condition when kcm_unattach(psock) and kcm_release(kcm) are executed at the same time.
kcm_unattach() is missing a check of the flag kcm->tx_stopped before calling queue_work().
If the kcm has a reserved psock, kcm_unattach() might get executed between cancel_work_sync() and unreserve_psock() in kcm_release(), requeuing kcm->tx_work right before kcm gets freed in kcm_done().
Remove kcm->tx_stopped and replace it by the less error-prone disable_work_sync().
From the CVE record · Linux
The Linux kernel’s KCM code has a race between kcm_unattach() and kcm_release(). If they run concurrently while a psock is reserved, work can be requeued just before the KCM object is freed. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with KCM should check their vendor’s advisory for affected versions; none are listed in the input.