RDMA/efa: Fix wrong resources deallocation order
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/efa: Fix wrong resources deallocation order
When trying to destroy QP or CQ, we first decrease the refcount and potentially free memory regions allocated for the object and then request the device to destroy the object. If the device fails, the object isn't fully destroyed so the user/IB core can try to destroy the object again which will lead to underflow when trying to decrease an already zeroed refcount.
Deallocate resources in reverse order of allocating them to safely free them.
From the CVE record · Linux
The Linux kernel’s RDMA/efa driver can free resources before the device confirms that a queue pair or completion queue was destroyed. If the device fails to destroy the object, a subsequent destruction attempt by a user or the IB core can underflow its refcount.
Engineers running Linux kernels with the RDMA/efa driver should check their vendor advisory; affected versions were not provided.