In the Linux kernel, the following vulnerability has been resolved:
ceph: fix possible deadlock when holding Fwb to get inline_data
1, mount with wsync. 2, create a file with O_RDWR, 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->iinline_version 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
[
{
"deprecated": false,
"id": "CVE-2022-49296-1bffa559",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@292b7a7275ce535a1abfa4dd0b2e586162aaae1e",
"signature_version": "v1",
"target": {
"file": "fs/ceph/addr.c"
},
"signature_type": "Line",
"digest": {
"line_hashes": [
"138030894819119864484624044508265131121",
"50201638140182221183969947673339422794",
"118664685873393349021580174327817430380",
"184919541593890342972512453838222235483",
"226979789902497804776288413639721348929",
"118631051614742994613153381528971043753",
"127402567242571957012936049185328199691",
"86183435415765943852009646436532510897",
"123532072837904345493755818872466732409",
"233108748723716757027722999997986962799",
"42548015932185815382194993127492100986",
"305344490160208844801404259035492605337",
"90740638818566532230483527127856990700",
"247226240253923942261033416479622004157",
"180791694019765637490802518940428649427",
"137892919390632832364388845618702685800",
"285889966280908043915395757874632355653",
"242345465459672373636538061763703478534",
"263090870800395768903917410690613678163",
"290245425837552905046102176163313525797",
"208819493447799864756073913916685863790",
"105750745247340044413506627832307932372",
"66153450418758783162190460745029090909",
"266679538238045871216295126515335732763",
"247068407953628672193423641618213847160",
"339254899675066301607318887371991452742",
"244150703267676447838119222395399746493",
"227634950459086566443903018265632996925",
"184052679411635595732255441502891488413"
],
"threshold": 0.9
}
},
{
"deprecated": false,
"id": "CVE-2022-49296-464d7759",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@825978fd6a0defc3c29d8a38b6cea76a0938d21e",
"signature_version": "v1",
"target": {
"function": "ceph_uninline_data",
"file": "fs/ceph/addr.c"
},
"signature_type": "Function",
"digest": {
"function_hash": "50241870804355407008877328688702504898",
"length": 2878.0
}
},
{
"deprecated": false,
"id": "CVE-2022-49296-a6a45eec",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@825978fd6a0defc3c29d8a38b6cea76a0938d21e",
"signature_version": "v1",
"target": {
"file": "fs/ceph/addr.c"
},
"signature_type": "Line",
"digest": {
"line_hashes": [
"138030894819119864484624044508265131121",
"50201638140182221183969947673339422794",
"118664685873393349021580174327817430380",
"184919541593890342972512453838222235483",
"226979789902497804776288413639721348929",
"118631051614742994613153381528971043753",
"127402567242571957012936049185328199691",
"86183435415765943852009646436532510897",
"123532072837904345493755818872466732409",
"233108748723716757027722999997986962799",
"42548015932185815382194993127492100986",
"305344490160208844801404259035492605337",
"90740638818566532230483527127856990700",
"247226240253923942261033416479622004157",
"180791694019765637490802518940428649427",
"137892919390632832364388845618702685800",
"285889966280908043915395757874632355653",
"242345465459672373636538061763703478534",
"263090870800395768903917410690613678163",
"290245425837552905046102176163313525797",
"208819493447799864756073913916685863790",
"105750745247340044413506627832307932372",
"66153450418758783162190460745029090909",
"266679538238045871216295126515335732763",
"247068407953628672193423641618213847160",
"339254899675066301607318887371991452742",
"244150703267676447838119222395399746493",
"227634950459086566443903018265632996925",
"184052679411635595732255441502891488413"
],
"threshold": 0.9
}
},
{
"deprecated": false,
"id": "CVE-2022-49296-e481f379",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@292b7a7275ce535a1abfa4dd0b2e586162aaae1e",
"signature_version": "v1",
"target": {
"function": "ceph_uninline_data",
"file": "fs/ceph/addr.c"
},
"signature_type": "Function",
"digest": {
"function_hash": "50241870804355407008877328688702504898",
"length": 2878.0
}
}
]