CVE-2024-35902: net/rds: fix possible cp null dereference
In the Linux kernel, the following vulnerability has been resolved:
net/rds: fix possible cp null dereference
cp might be null, calling cp->cpconn would produce null dereference
[Simon Horman adds:]
Analysis:
cp is a parameter of rdsrdmamap and is not reassigned.
The following call-sites pass a NULL cp argument to rdsrdmamap()
- rdsgetmr() - rdsgetmrfordest
Prior to the code above, the following assumes that cp may be NULL (which is indicative, but could itself be unnecessary)
transprivate = rs->rstransport->getmr( sg, nents, rs, &mr->rkey, cp ? cp->cpconn : NULL, args->vec.addr, args->vec.bytes, needodp ? ODPZEROBASED : ODPNOTNEEDED);
The code modified by this patch is guarded by ISERR(transprivate), where transprivate is assigned as per the previous point in this analysis.
The only implementation of getmr that I could locate is rdsibgetmr() which can return an ERRPTR if the conn (4th) argument is NULL.
ret is set to PTRERR(transprivate). rdsibgetmr can return ERRPTR(-ENODEV) if the conn (4th) argument is NULL. Thus ret may be -ENODEV in which case the code in question will execute.
Conclusion: cp may be NULL at the point where this patch adds a check; this patch does seem to address a possible bug
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-35902?
CVE-2024-35902 is considered a medium severity vulnerability due to its potential to cause null dereference issues in the Linux kernel.
How do I fix CVE-2024-35902?
To fix CVE-2024-35902, upgrade to the patched versions of the Linux kernel specified in the vulnerability report.
Which versions of the Linux kernel are affected by CVE-2024-35902?
CVE-2024-35902 affects specific versions of the Linux kernel between 4.19.310 and 4.19.312, as well as several ranges from 5.4.272 to 6.9-rc2.
What causes the null dereference in CVE-2024-35902?
The null dereference in CVE-2024-35902 is caused by the parameter 'cp' being potentially null when attempting to access 'cp->cp_conn'.
Is there a workaround for CVE-2024-35902?
There is no documented workaround for CVE-2024-35902, and updating to a secure kernel version is the recommended action.