RDMA/rxe: Fix a use-after-free problem in rxe_mmap
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8700e3e7c4857d28ebaa824509934556da0b3e76 · < e59a6aa89e0fcd1d0707832eb4654fd9ae7d31e6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: Fix a use-after-free problem in rxe_mmap
rxe_mmap() removes a rxe_mmap_info struct from the pending_mmaps list and releases pending_lock while the struct's kref is still at 1:
list_del_init(&ip->pending_mmaps); spin_unlock_bh(&rxe->pending_lock); /* ref == 1, no lock held */ ret = remap_vmalloc_range(vma, ip->obj, 0); /* walks PTEs */ [...] rxe_vma_open(vma); /* kref_get, ref → 2 */ remap_vmalloc_range_partial() walks PTEs without any lock.
A concurrent DESTROY_CQ ioctl on another CPU calls:
kref_put(&q->ip->ref, rxe_mmap_release) /* ref 1→0 */ vfree(ip->obj) /* clears vmalloc PTEs mid-walk */ kfree(ip) /* frees rxe_mmap_info */
This yields:
1. Kernel crash, vmalloc_to_page() returns NULL when vfree wins the per-PTE race -> vm_insert_page(NULL) → GPF in validate_page_before_insert
From the CVE record · Linux
The Linux kernel's RDMA/rxe mmap path has a use-after-free race. A local attacker who triggers concurrent mmap and DESTROY_CQ operations can cause a kernel crash or potentially leave a mapping to a freed page. The page-level use-after-free is described as statistically very difficult to achieve.
Engineers running Linux kernels with RDMA/rxe should check whether their kernel is affected; affected versions were not specified.