Linux
RDMA/irdma: Fix out-of-bounds write in irdma_copy_user_pgaddrs
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 4780f58672ee6328accd54a95f9c00683477e499
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 79a20a8e201a779224b4bf115250a7713bde72c0
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 9f8f0d2099e3de1194e37dc933ae0c4206b09aaf
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 192a3be0e3759daa24af2841208b074ca6dbaabc
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 424d51d33c7541a86934067c2c0538124687fc90
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < abd27a977b419d584efa659488c22d2306987b29
- >= b48c24c2d710cf34810c555dcef883a3d35a9c08, < 5ebb3ed757be3e04cf803026004aa0beaeb13e9b
Fixed in 4780f58672ee6328accd54a95f9c00683477e499, 79a20a8e201a779224b4bf115250a7713bde72c0, 9f8f0d2099e3de1194e37dc933ae0c4206b09aaf, 192a3be0e3759daa24af2841208b074ca6dbaabc, 424d51d33c7541a86934067c2c0538124687fc90, abd27a977b419d584efa659488c22d2306987b29, 5ebb3ed757be3e04cf803026004aa0beaeb13e9b
- 5.14
Fixed in 0, 5.15.212, 6.1.178, 6.6.145, 6.12.97, 6.18.40, 7.1.5, 7.2
Mitigation
Upgrade Linux to 4780f58672ee6328accd54a95f9c00683477e499 or 79a20a8e201a779224b4bf115250a7713bde72c0 or 9f8f0d2099e3de1194e37dc933ae0c4206b09aaf or 192a3be0e3759daa24af2841208b074ca6dbaabc or 424d51d33c7541a86934067c2c0538124687fc90 or abd27a977b419d584efa659488c22d2306987b29 or 5ebb3ed757be3e04cf803026004aa0beaeb13e9b or later.
Upgrade Linux to 0 or 5.15.212 or 6.1.178 or 6.6.145 or 6.12.97 or 6.18.40 or 7.1.5 or 7.2 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.