In the Linux kernel, the following vulnerability has been resolved:
cachefiles: fix dentry leak in cachefilesopenfile()
A dentry leak may be caused when a lookup cookie and a cull are concurrent:
cachefileslookupcookie cachefileslookupobject lookuponepositiveunlocked // get dentry cachefilescull inode->iflags |= SKERNELFILE; cachefilesopenfile cachefilesmarkinodeinuse _cachefilesmarkinodeinuse canuse = false if (!(inode->iflags & SKERNELFILE)) canuse = true return false return false // Returns an error but doesn't put dentry
After that the following WARNING will be triggered when the backend folder is umounted:
================================================================== BUG: Dentry 000000008ad87947{i=7a,n=Dx11.img} still in use (1) [unmount of ext4 sda] WARNING: CPU: 4 PID: 359261 at fs/dcache.c:1767 umountcheck+0x5d/0x70 CPU: 4 PID: 359261 Comm: umount Not tainted 6.6.0-dirty #25 RIP: 0010:umountcheck+0x5d/0x70 Call Trace: <TASK> dwalk+0xda/0x2b0 doonetree+0x20/0x40 shrinkdcacheforumount+0x2c/0x90 genericshutdownsuper+0x20/0x160 killblocksuper+0x1a/0x40 ext4killsb+0x22/0x40 deactivatelockedsuper+0x35/0x80
Whether cachefilesopenfile() returns true or false, the reference count obtained by lookuppositiveunlocked() in cachefileslookup_object() should be released.
Therefore release that reference count in cachefileslookup_object() to fix the above issue and simplify the code.
[
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d32ff64c872d7e08e893c32ba6a2374583444410",
"digest": {
"line_hashes": [
"217806645210525347293812124405727304792",
"167615946730629376152787137840886768142",
"11105011157348145125229142875929830323",
"251751924044208362134597490320166075965",
"210753120180111205315489822341157903598",
"205339527215268998387303664956059847983",
"269629187639172029131668160453400183178",
"257897944371715971750459910552679362808",
"108810678188899616886902260911387004252",
"135973303682295469626417632665944708829",
"189066990358164446173112571532277342116",
"146292177689228895750409325692046269822",
"161879230783517412318481334432433476995",
"117346236575165882167684206758495595692",
"257014457188919713860710861773597505881",
"62174885154205320896154947983263837522",
"307603371016444213663599617590596743622",
"306105880335544998929723260763676608967"
],
"threshold": 0.9
},
"id": "CVE-2024-49870-099e0f52"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_look_up_object"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7fa2382f97421978514a419c93054eca69f5247b",
"digest": {
"length": 1020.0,
"function_hash": "36551789086859408623984130529958312962"
},
"id": "CVE-2024-49870-18a222f5"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@da6ef2dffe6056aad3435e6cf7c6471c2a62187c",
"digest": {
"line_hashes": [
"217806645210525347293812124405727304792",
"167615946730629376152787137840886768142",
"11105011157348145125229142875929830323",
"251751924044208362134597490320166075965",
"210753120180111205315489822341157903598",
"205339527215268998387303664956059847983",
"269629187639172029131668160453400183178",
"257897944371715971750459910552679362808",
"108810678188899616886902260911387004252",
"135973303682295469626417632665944708829",
"189066990358164446173112571532277342116",
"146292177689228895750409325692046269822",
"161879230783517412318481334432433476995",
"117346236575165882167684206758495595692",
"257014457188919713860710861773597505881",
"62174885154205320896154947983263837522",
"307603371016444213663599617590596743622",
"306105880335544998929723260763676608967"
],
"threshold": 0.9
},
"id": "CVE-2024-49870-1de9ddaa"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_open_file"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c7d10fa7d7691558ff967668494672415f5fa151",
"digest": {
"length": 1430.0,
"function_hash": "266992675700433920436753810638774304434"
},
"id": "CVE-2024-49870-2454032e"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_open_file"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d32ff64c872d7e08e893c32ba6a2374583444410",
"digest": {
"length": 1430.0,
"function_hash": "266992675700433920436753810638774304434"
},
"id": "CVE-2024-49870-2e454ce5"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_open_file"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7fa2382f97421978514a419c93054eca69f5247b",
"digest": {
"length": 1409.0,
"function_hash": "290926674883235186641557839098618271516"
},
"id": "CVE-2024-49870-39e573ff"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_look_up_object"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c7d10fa7d7691558ff967668494672415f5fa151",
"digest": {
"length": 1020.0,
"function_hash": "36551789086859408623984130529958312962"
},
"id": "CVE-2024-49870-3dd83759"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_look_up_object"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d32ff64c872d7e08e893c32ba6a2374583444410",
"digest": {
"length": 1020.0,
"function_hash": "36551789086859408623984130529958312962"
},
"id": "CVE-2024-49870-470ca0a6"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c7d10fa7d7691558ff967668494672415f5fa151",
"digest": {
"line_hashes": [
"217806645210525347293812124405727304792",
"167615946730629376152787137840886768142",
"11105011157348145125229142875929830323",
"251751924044208362134597490320166075965",
"210753120180111205315489822341157903598",
"205339527215268998387303664956059847983",
"269629187639172029131668160453400183178",
"257897944371715971750459910552679362808",
"108810678188899616886902260911387004252",
"135973303682295469626417632665944708829",
"189066990358164446173112571532277342116",
"146292177689228895750409325692046269822",
"161879230783517412318481334432433476995",
"117346236575165882167684206758495595692",
"257014457188919713860710861773597505881",
"62174885154205320896154947983263837522",
"307603371016444213663599617590596743622",
"306105880335544998929723260763676608967"
],
"threshold": 0.9
},
"id": "CVE-2024-49870-7e1e3dac"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_look_up_object"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@da6ef2dffe6056aad3435e6cf7c6471c2a62187c",
"digest": {
"length": 1020.0,
"function_hash": "36551789086859408623984130529958312962"
},
"id": "CVE-2024-49870-9f4a32ba"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7fa2382f97421978514a419c93054eca69f5247b",
"digest": {
"line_hashes": [
"217806645210525347293812124405727304792",
"167615946730629376152787137840886768142",
"11105011157348145125229142875929830323",
"251751924044208362134597490320166075965",
"210753120180111205315489822341157903598",
"205339527215268998387303664956059847983",
"269629187639172029131668160453400183178",
"257897944371715971750459910552679362808",
"108810678188899616886902260911387004252",
"135973303682295469626417632665944708829",
"189066990358164446173112571532277342116",
"146292177689228895750409325692046269822",
"161879230783517412318481334432433476995",
"117346236575165882167684206758495595692",
"257014457188919713860710861773597505881",
"62174885154205320896154947983263837522",
"307603371016444213663599617590596743622",
"306105880335544998929723260763676608967"
],
"threshold": 0.9
},
"id": "CVE-2024-49870-b3831d6c"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/cachefiles/namei.c",
"function": "cachefiles_open_file"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@da6ef2dffe6056aad3435e6cf7c6471c2a62187c",
"digest": {
"length": 1409.0,
"function_hash": "290926674883235186641557839098618271516"
},
"id": "CVE-2024-49870-d67f9439"
}
]