RDMA/efa: Fix PBL chunk length computation
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 40909f664d279765af430acc5db348a0b71c9b0a · < da7805f0211af19968584e621074f253ac07dba7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/efa: Fix PBL chunk length computation
On register MR, when creating the PBL, if it's an indirect PBL we create a chunk list to hold the PBL pages pointers. Each chunk is 4KB in size and can hold 510 addresses (EFA_PTRS_PER_CHUNK) and has a 12-byte control buffer at the end of it holding the next chunk's pointer and its length.
If the PBL number of pages is a multiple of EFA_PTRS_PER_CHUNK, the calculated last chunk length is wrongly computed as 0, even though that chunk is fully populated with 510 real page pointers. This wrong length is used both to DMA map the chunk and is propagated to the device, causing the device to see the chunk as empty and reject the memory registration.
Fix the calculation so it will be performed only if the number of pages isn't a multiple of EFA_PTRS_PER_CHUNK, if it is, its already handled in the above loop correctly. Also prevent out-of-bounds reach in the chunks array in such scenario.
From the CVE record · Linux
The Linux kernel’s RDMA/efa driver computes an incorrect length for the last indirect PBL chunk when the page count is a multiple of 510. This can cause the device to reject memory registration and may allow an out-of-bounds access to the chunks array. The input does not describe an attacker or specify network access, authentication, or user interaction requirements.
Engineers running Linux kernels that use the RDMA/efa driver should check their kernel versions; affected versions are not specified.