In the Linux kernel, the following vulnerability has been resolved:
exfat: fix potential deadlock on _exfatgetdentryset
When accessing a file with more entries than ESMAXENTRY_NUM, the bh-array is allocated in _exfatgetentryset. The problem is that the bh-array is allocated with GFPKERNEL. It does not make sense. In the following cases, a deadlock for sbi->slock between the two processes may occur.
CPU0 CPU1
---- ----
kswapd balancepgdat lock(fsreclaim) exfatiterate lock(&sbi->slock) exfatreaddir exfatgetuninamefromextentry exfatgetdentry_set __exfatgetdentryset kmallocarray ... lock(fsreclaim) ... evict exfatevictinode lock(&sbi->slock)
To fix this, let's allocate bh-array with GFP_NOFS.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42315.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42315.json"
[
{
"signature_version": "v1",
"target": {
"file": "fs/exfat/dir.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89fc548767a2155231128cb98726d6d2ea1256c9",
"deprecated": false,
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"286643922036781056355499354229617786776"
],
"threshold": 0.9
},
"id": "CVE-2024-42315-6368fb5f",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"file": "fs/exfat/dir.c",
"function": "__exfat_get_dentry_set"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89fc548767a2155231128cb98726d6d2ea1256c9",
"deprecated": false,
"digest": {
"function_hash": "312950726758801594496999853219023322772",
"length": 1600.0
},
"id": "CVE-2024-42315-7b6f23e5",
"signature_type": "Function"
}
]