In the Linux kernel, the following vulnerability has been resolved:
exfat: fix potential deadlock on _exfatgetdentryset
When accessing a file with more entries than ESMAXENTRYNUM, 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->s_lock between the two processes may occur.
CPU0 CPU1
---- ----
kswapd balancepgdat lock(fsreclaim) exfatiterate lock(&sbi->slock) exfatreaddir exfatgetuninamefromextentry exfatgetdentryset _exfatgetdentryset kmallocarray ... lock(fsreclaim) ... evict exfatevictinode lock(&sbi->slock)
To fix this, let's allocate bh-array with GFP_NOFS.
[
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"286643922036781056355499354229617786776"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d1970493c289e3f44b9ec847ed26a5dbdf56a62",
"id": "CVE-2024-42315-022f1514",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"286643922036781056355499354229617786776"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7ac198f8dba791e3144c4da48a5a9b95773ee4b",
"id": "CVE-2024-42315-2de9007e",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "312950726758801594496999853219023322772",
"length": 1600.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d1970493c289e3f44b9ec847ed26a5dbdf56a62",
"id": "CVE-2024-42315-2e6a80a9",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "__exfat_get_dentry_set"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "201627415105757038009401434267392365809",
"length": 1763.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7ac198f8dba791e3144c4da48a5a9b95773ee4b",
"id": "CVE-2024-42315-51bbdfa9",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "exfat_get_dentry_set"
}
},
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"286643922036781056355499354229617786776"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89fc548767a2155231128cb98726d6d2ea1256c9",
"id": "CVE-2024-42315-6368fb5f",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "312950726758801594496999853219023322772",
"length": 1600.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89fc548767a2155231128cb98726d6d2ea1256c9",
"id": "CVE-2024-42315-7b6f23e5",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "__exfat_get_dentry_set"
}
},
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"66124880207932969646279158787366430653"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd1c7858641384191ff7033fb1fc65dfcd559c6f",
"id": "CVE-2024-42315-9718bb46",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "118396812635157371956782322780695149231",
"length": 1874.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@632fb232b6bbf8277edcbe9ecd4b4d98ecb122eb",
"id": "CVE-2024-42315-ab38d896",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "exfat_get_dentry_set"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "118396812635157371956782322780695149231",
"length": 1874.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd1c7858641384191ff7033fb1fc65dfcd559c6f",
"id": "CVE-2024-42315-ab93df61",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "exfat_get_dentry_set"
}
},
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"66124880207932969646279158787366430653"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@632fb232b6bbf8277edcbe9ecd4b4d98ecb122eb",
"id": "CVE-2024-42315-aeb115e8",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"line_hashes": [
"324728347340300075220158138091294301624",
"65363913030259145238411681096164731779",
"109794227318602971069021117993179397986",
"66124880207932969646279158787366430653"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c052f775ee6ccacd3c97e4cf41a2a657e63d4259",
"id": "CVE-2024-42315-b602d408",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c"
}
},
{
"signature_version": "v1",
"digest": {
"function_hash": "118396812635157371956782322780695149231",
"length": 1874.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c052f775ee6ccacd3c97e4cf41a2a657e63d4259",
"id": "CVE-2024-42315-ba4e92a5",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "fs/exfat/dir.c",
"function": "exfat_get_dentry_set"
}
}
]