svcrdma: Clear sc_cm_id when ADDR_CHANGE replacement fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
svcrdma: Clear sc_cm_id when ADDR_CHANGE replacement fails
When svc_rdma_listen_handler() handles RDMA_CM_EVENT_ADDR_CHANGE, it creates a replacement listener cm_id and returns 1, telling the CM core to destroy the old one. If the replacement allocation fails, sc_cm_id still points at the old cm_id that the CM core is about to destroy. Any subsequent dereference of sc_cm_id -- such as svc_rdma_detach()'s rdma_disconnect() call -- is a use-after-free.
NULL sc_cm_id on the failure path and guard svc_rdma_detach()'s rdma_disconnect() call against NULL so that the listener can be torn down safely when the server shuts down.
From the CVE record · Linux
The Linux kernel's svcrdma listener can retain a pointer to a destroyed RDMA connection ID if replacement allocation fails while handling an address-change event. A later dereference, including during server shutdown, can cause a use-after-free. The input does not specify attacker access requirements or whether user interaction is needed.
Operators running Linux kernels with the svcrdma listener should check their kernel against the vendor advisory; affected versions are not specified.