In the Linux kernel, the following vulnerability has been resolved:
net/rds: fix possible cp null dereference
cp might be null, calling cp->cp_conn would produce null dereference
[Simon Horman adds:]
Analysis:
cp is a parameter of _rdsrdma_map and is not reassigned.
The following call-sites pass a NULL cp argument to _rdsrdma_map()
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 : ODPNOT_NEEDED);
The code modified by this patch is guarded by ISERR(transprivate), where trans_private 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 ERR_PTR 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