RDMA/rxe: Fix UAF in ODP init error-handling path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.527.2.67.3In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: Fix UAF in ODP init error-handling path
rxe_odp_mr_init_user() stores &umem_odp->umem in mr->umem before calling rxe_odp_init_pages(). If rxe_odp_init_pages() fails, rxe_odp_mr_init_user() releases umem_odp and returns an error.
rxe_reg_user_mr() then unwinds the error through rxe_cleanup(), rxe_mr_cleanup(), ib_umem_release(mr->umem). There is an IS_ERR_OR_NULL(umem) check at the start of ib_umem_release(). But since mr->umem is NOT reset to NULL in the error handling path of rxe_odp_mr_init_user(), the check passes and it reads already-freed fields like umem->is_dmabuf, causing UAF.
Fix the UAF by clearing mr->umem after releasing the failed ODP umem so the MR cleanup path does not release it again.
From the CVE record · Linux
The Linux kernel’s RDMA/rxe driver can use freed memory when ODP page initialization fails during user memory-region registration. A local caller reaching this error path can trigger cleanup that accesses an already-freed memory object; the input does not specify authentication requirements.
Engineers running Linux kernels with the RDMA/rxe driver should check whether their kernel includes the fix; affected versions are not specified.