staging: nvec: fix use-after-free in nvec_rx_completed()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d6bdcf2e1019351cbc176e963b7756766bdd8721 · < bb3d592c7d6c4ec8ac6640c690ca13298e7e8e90| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
staging: nvec: fix use-after-free in nvec_rx_completed()
In nvec_rx_completed(), when an incomplete RX transfer is detected, nvec_msg_free() is called to return the message back to the pool by clearing its 'used' atomic flag. Immediately after this, the code accesses nvec->rx->data[0] to check the message type.
Since nvec_msg_free() marks the pool slot as available via atomic_set(), any concurrent or subsequent call to nvec_msg_alloc() could claim that same slot and overwrite its data[] array. Reading nvec->rx->data[0] after freeing the message is therefore a use-after-free.
Fix this by saving the message type byte before calling nvec_msg_free(), then using the saved value for the battery quirk check.
From the CVE record · Linux
The Linux kernel's staging nvec driver reads a message byte after returning the message to its pool during an incomplete RX transfer. If another allocation reuses that slot, it can overwrite the byte before the read. The input does not specify an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels with the staging nvec driver should check their versions; affected versions are not specified.