bnxt_en: Handle buffer allocation failure in bnxt_rx_ring_reset()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8fbf58e17dce8f250dda9ad6b0a49b3041f0af14 · < 4a17c73c83798c2fa9c7920ad5a98803adce3e01| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bnxt_en: Handle buffer allocation failure in bnxt_rx_ring_reset()
bnxt_rx_ring_reset() frees the ring buffers and then reallocates them, ignoring the result.
bnxt_alloc_one_rx_ring() can fail in bnxt_alloc_one_tpa_info_data(), which returns -ENOMEM on the first failed allocation and leaves the remaining rxr->rx_tpa[] entries zeroed.
The error isn't propagated up, so the loop in bnxt_rx_ring_reset continues and at the end the code re-enables TPA with partially unallocated rx_tpa array.
This means that when the agg_id from hardware is mapped to a SW index in rxr->rx_tpa[], an uninitialized slot can be chosen which would hand a zero DMA address to the device.
Fix this by falling back to a global reset, which is what the existing code already does when other functions fail, but unlike the other failure cases this particular failure has to return because TPA can't be re-enabled since the allocation failed.
From the CVE record · Linux
The Linux kernel's bnxt_en driver can re-enable TPA after an RX ring buffer allocation fails, leaving entries unallocated and potentially handing a zero DMA address to the device. The input does not describe an attacker or specify network access, authentication, or user interaction requirements.
Engineers running Linux kernels with the bnxt_en driver should check their kernel versions against the vendor advisory; affected versions are not specified.