RDMA/nldev: Fix locking when accessing mr->pd
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ da5c8507821573b8ed6e3f47e009f273493ffaf7 · < 50d5c02ab8e62325548bd3a6e6b758a9dcd6e7c3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/nldev: Fix locking when accessing mr->pd
Sashiko points out that, due to rereg_mr, the PD is actually variable and all the touches in nldev are racy.
Use mr->device instead of mr->pd->device.
Getting the PD restrack ID is more tricky. To avoid disturbing all the happy paths, add an rdma_restrack_sync() operation which is sort of like flush_workqueue() or synchronize_irq(): after it returns, all the old nldev touches to the mr are gone and everything sees the new PD. This makes it safe to reach into the PD pointer.
From the CVE record · Linux
RDMA/nldev accesses a memory region’s protection domain (PD) without sufficient synchronization while the PD can change during rereg_mr. The input does not specify what an attacker could do or whether exploitation requires network access, local access, authentication, or user interaction.
Engineers running the Linux kernel should check whether their version includes the RDMA/nldev fix; affected versions were not specified.