CVE-2022-49296: ceph: fix possible deadlock when holding Fwb to get inline_data
In the Linux kernel, the following vulnerability has been resolved:
ceph: fix possible deadlock when holding Fwb to get inlinedata
1, mount with wsync. 2, create a file with ORDWR, and the request was sent to mds.0:
cephatomicopen()--> cephmdscdorequest(openc) finishopen(file, dentry, cephopen)--> cephopen()--> cephinitfile()--> cephinitfileinfo()--> cephuninlinedata()--> { ... if (inlineversion == 1 || / initial version, no data / inlineversion == CEPHINLINENONE) goto outunlock; ... }
The inlineversion will be 1, which is the initial version for the new create file. And here the ci->iinlineversion will keep with 1, it's buggy.
3, buffer write to the file immediately:
cephwriteiter()--> cephgetcaps(file, need=Fw, want=Fb, ...); genericperformwrite()--> aops->writebegin()--> cephwritebegin()--> netfswritebegin()--> netfsbeginread()--> netfsrreqsubmitslice()--> netfsreadfromserver()--> rreq->netfsops->issueread()--> cephnetfsissueread()--> { ... if (ci->iinlineversion != CEPHINLINENONE && cephnetfsissueopinline(subreq)) return; ... } cephputcaprefs(ci, Fwb);
The cephnetfsissueopinline() will send a getattr(Fsr) request to mds.1.
4, then the mds.1 will request the rd lock for CInode::filelock from the auth mds.0, the mds.0 will do the CInode::filelock state transation from excl --> sync, but it need to revoke the Fxwb caps back from the clients.
While the kernel client has aleady held the Fwb caps and waiting for the getattr(Fsr).
It's deadlock!
URL: https://tracker.ceph.com/issues/55377
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2022-49296?
CVE-2022-49296 has been designated as an important severity vulnerability due to the potential for deadlock scenarios.
How do I fix CVE-2022-49296?
To fix CVE-2022-49296, ensure that your Linux kernel is updated to the latest version that includes the patch for this vulnerability.
Which versions of the Linux kernel are affected by CVE-2022-49296?
CVE-2022-49296 affects specific versions of the Linux kernel that utilize the Ceph filesystem, particularly those with wsync settings enabled.
What is the impact of CVE-2022-49296 on Ceph file systems?
The impact of CVE-2022-49296 on Ceph file systems includes potential deadlocks when creating or accessing files, which can disrupt normal operations.
Is CVE-2022-49296 exploited in the wild?
As of the current information available, there are no confirmed exploits of CVE-2022-49296 in the wild.