summaryrefslogtreecommitdiff
path: root/drivers/android/binder/range_alloc/array.rs
diff options
context:
space:
mode:
authorJacob Moroni <jmoroni@google.com>2026-05-12 18:38:52 +0000
committerJason Gunthorpe <jgg@nvidia.com>2026-05-25 10:50:42 -0300
commit5ebb3ed757be3e04cf803026004aa0beaeb13e9b (patch)
treea8c6a58bf31d52834947269c66f87ce84c078aa3 /drivers/android/binder/range_alloc/array.rs
parentd28654518c8db5d06d27bd3211c0e9a70c18f7c2 (diff)
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. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://patch.msgid.link/r/20260512183852.614045-1-jmoroni@google.com Signed-off-by: Jacob Moroni <jmoroni@google.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/android/binder/range_alloc/array.rs')
0 files changed, 0 insertions, 0 deletions