RDMA/irdma: Fix out-of-bounds write in irdma_copy_user_pgaddrs
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b48c24c2d710cf34810c555dcef883a3d35a9c08 · < abd27a977b419d584efa659488c22d2306987b29| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/irdma: Fix out-of-bounds write in irdma_copy_user_pgaddrs
The irdma_copy_user_pgaddrs function loops through all of the umem DMA blocks to populate the PBLEs and will stop when either the last DMA block is reached or palloc->total_cnt is reached. The issue is that the logic for checking palloc->total_cnt would only work for non-zero values.
When irdma_setup_pbles is called with lvl==0, it calls irdma_copy_user_pgaddrs with palloc->total_cnt==0, which means the only way to break out of the loop is to reach the last umem DMA block, which means it could end up going beyond the fixed size of 4 iwmr->pgaddrmem array that is used in the lvl==0 case.
In the case of QP/CQ/SRQ rings, the value of lvl is determined by a separate input (for example, req.cq_pages in the case of a CQ). So, we must perform explicit checking to ensure we don't overflow the pgaddrmem array if the user provides a umem that consists of more blocks than their provided req.cq_pages.
From the CVE record · Linux
The Linux kernel's RDMA/irdma driver can write beyond a fixed-size array when irdma_copy_user_pgaddrs processes more user-memory DMA blocks than the array can hold. This can occur when a user supplies memory with more blocks than indicated by a separate ring-page input; the input does not specify authentication requirements or further impact.
Engineers running Linux kernels with the RDMA/irdma driver should check whether their kernel includes the fix; affected versions are not specified.