ksmbd: fix listener task lifetime on netdev events
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:
ksmbd: fix listener task lifetime on netdev events
The listener thread exits when its listening socket is shutdown. The netdevice notifier shuts down the socket before calling kthread_stop(), so the task_struct can be freed before kthread_stop() gets its reference.
Create the listener in a stopped state and hold an extra task_struct reference until kthread_stop_put() completes. Also stop and release listeners before freeing their interface records during TCP teardown.
From the CVE record · Linux
The Linux kernel’s ksmbd listener has a task-lifetime race during network-device events and TCP teardown. Its task structure can be freed before shutdown code obtains a reference to it, causing a use-after-free. The input does not specify whether exploitation requires network or local access, authentication, or user interaction.
Engineers running Linux kernels with ksmbd should check their versions against the vendor advisory; affected versions are not specified.