nvme-rdma: destroy cm id before destroy qp to avoid use after free
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 |
|
|
5.10.705.14.95.15In the Linux kernel, the following vulnerability has been resolved:
nvme-rdma: destroy cm id before destroy qp to avoid use after free
We should always destroy cm_id before destroy qp to avoid to get cma event after qp was destroyed, which may lead to use after free. In RDMA connection establishment error flow, don't destroy qp in cm event handler.Just report cm_error to upper level, qp will be destroy in nvme_rdma_alloc_queue() after destroy cm id.
From the CVE record · Linux
The Linux kernel's nvme-rdma code can destroy a queue pair before its connection manager ID during an RDMA connection establishment error. A later connection manager event can then cause a use-after-free. The input does not specify how an attacker could trigger this condition or whether authentication or user interaction is required.
Engineers running Linux kernels with nvme-rdma should check whether their kernel is affected; no affected versions are specified.