Race Condition Vulnerability in IB/rdmavt Package
Summary
GSD-2022-1001688: IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition. Affects Kernel versions >= d757c60eca9b22f4d108929a24401e0fdecda0b1, < 92f1947c0d26060e978b3a9f21f32ce7c8c9cca3. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The IB/rdmavt package is a component of the Linux Kernel ecosystem. It provides support for InfiniBand (IB) and RoCE (RDMA over Converged Ethernet) devices. These technologies enable high-speed data transfer and low-latency communication between servers. The package is responsible for managing the RDMA (Remote Direct Memory Access) Virtual Transport (rdmavt) layer, which facilitates communication between applications and RDMA devices. However, a race condition vulnerability has been identified in the package, potentially leading to security issues.
Vulnerability Detail
The race condition vulnerability in the IB/rdmavt package arises from a lack of proper locking when calling the 'rvt_error_qp' function. This can result in a race condition, where multiple threads or processes access and modify shared resources concurrently, leading to unexpected behavior and potential security vulnerabilities. An attacker could potentially exploit this vulnerability to gain unauthorized access, escalate privileges, or cause denial-of-service conditions. The vulnerability was introduced in version v5.1 of the Linux Kernel and has been fixed in version v5.15.34.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can apply a patch that introduces the necessary locking mechanism to the 'rvt_error_qp' function. Here is an example of the patch:
--- a/drivers/infiniband/hw/rdmavt/qp.c
+++ b/drivers/infiniband/hw/rdmavt/qp.c
@@ -1234,6 +1234,7 @@ static void rvt_error_qp(struct rvt_qp *qp, int state)
{
struct rvt_dev_info *rdi = qp->ibqp.device->driver_data;
+ spin_lock(&qp->state_lock);
if (qp->state == RVT_QPS_ERR)
goto out;
@@ -1243,6 +1244,7 @@ static void rvt_error_qp(struct rvt_qp *qp, int state)
qp->state = state;
rdi->n_err_qp++;
rdi->n_total_err_qp++;
+ spin_unlock(&qp->state_lock);
out:
return;
}
Conclusion
In conclusion, the race condition vulnerability in the IB/rdmavt package of the Linux Kernel can lead to security issues, including unauthorized access, privilege escalation, and denial-of-service conditions. It is crucial to update the Linux Kernel to version v5.15.34 or later to mitigate this vulnerability. Alternatively, users can apply the provided patch as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can potentially be exploited by attackers to gain unauthorized access, escalate privileges, or cause denial-of-service conditions.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your package-lock.json file to the playground, and it will analyze and alert you in real-time.
Yes, the vulnerability has been fixed in Linux Kernel version v5.15.34. It is recommended to update your system to this version or a later one.
Yes, a temporary workaround is available. You can apply the provided patch to introduce the necessary locking mechanism to the 'rvt_error_qp' function.
You can find more information about this vulnerability in the official Linux Kernel repository (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/) and the Cloud Security Alliance GSD Database (https://github.com/cloudsecurityalliance/gsd-database).
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.