net: ravb: serialize PTP clock teardown
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a0d2f20650e81407d8e51ad2cbdc492861c74e9c · < 1cb9663789c5b7a12fcd419fcca6d6254c398252| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: ravb: serialize PTP clock teardown
ravb_ptp_interrupt() can race with ravb_ptp_stop() and pass the clock to ptp_clock_event() while ptp_clock_unregister() is freeing it. This can lead to a use-after-free.
Use READ_ONCE() and WRITE_ONCE() for lockless access to the clock pointer. Atomically detach it with xchg() before disabling PTP interrupts, then synchronize all IRQs which can invoke ravb_ptp_interrupt() before unregistering the detached clock.
A handler which read the old pointer completes before the clock is unregistered, while later handlers read NULL and skip the event.
From the CVE record · Linux
The Linux kernel’s ravb PTP interrupt handler can race with clock teardown and use a clock after it has been freed. The issue occurs during PTP clock teardown; the input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with the ravb driver should check their kernels; affected versions are not specified.