In the Linux kernel, the following vulnerability has been resolved:
mm: slub: fix flushcpuslab()/_freeslab() invocations in task context.
Commit 5a836bf6b09f ("mm: slub: move flushcpuslab() invocations freeslab() invocations out of IRQ context") moved all flushcpuslab() invocations to the global workqueue to avoid a problem related with deactivateslab()/freeslab() being called from an IRQ context on PREEMPTRT kernels.
When the flushallcpulocked() function is called from a task context it may happen that a workqueue with WQMEM_RECLAIM bit set ends up flushing the global workqueue, this will cause a dependency issue.
workqueue: WQMEMRECLAIM nvme-delete-wq:nvmedeletectrlwork [nvmecore] is flushing !WQMEMRECLAIM events:flushcpuslab WARNING: CPU: 37 PID: 410 at kernel/workqueue.c:2637 checkflushdependency+0x10a/0x120 Workqueue: nvme-delete-wq nvmedeletectrlwork [nvmecore] RIP: 0010:checkflushdependency+0x10a/0x120[ 453.262125] Call Trace: _flushwork.isra.0+0xbf/0x220 ? _queuework+0x1dc/0x420 flushallcpuslocked+0xfb/0x120 _kmemcacheshutdown+0x2b/0x320 kmemcachedestroy+0x49/0x100 biosetexit+0x143/0x190 blkreleasequeue+0xb9/0x100 kobjectcleanup+0x37/0x130 nvmefcctrlfree+0xc6/0x150 [nvmefc] nvmefreectrl+0x1ac/0x2b0 [nvme_core]
Fix this bug by creating a workqueue for the flush operation with the WQMEMRECLAIM bit set.
[
{
"digest": {
"function_hash": "243241260315654151173211410925035820757",
"length": 28.0
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45cc288724f0cfd497bb5920bcfa60caa335729",
"id": "CVE-2022-48658-00204e18",
"signature_version": "v1",
"target": {
"function": "kmem_cache_init_late",
"file": "mm/slub.c"
}
},
{
"digest": {
"function_hash": "19966484360713691985485587976390776385",
"length": 548.0
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45cc288724f0cfd497bb5920bcfa60caa335729",
"id": "CVE-2022-48658-5a991f57",
"signature_version": "v1",
"target": {
"function": "flush_all_cpus_locked",
"file": "mm/slub.c"
}
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"250382171308800824080726518065099333706",
"333763053365780776552483567709413511368",
"170747052252694705551059237828894267341",
"99499583704414981458827291034119215822",
"178804029249720339835687356151012375199",
"268326903485970762318815958582025440970",
"146608216884342844463727609653006817472",
"52454041172996786681917457486076416447",
"71110407748499326351911455128710240440",
"134121158576941512602948640909564362568",
"184458165097729329433236209088862073825"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df6cb39335cf5a1b918e8dbd8ba7cd9f1d00e45a",
"id": "CVE-2022-48658-7454325e",
"signature_version": "v1",
"target": {
"file": "mm/slub.c"
}
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"250382171308800824080726518065099333706",
"333763053365780776552483567709413511368",
"170747052252694705551059237828894267341",
"99499583704414981458827291034119215822",
"178804029249720339835687356151012375199",
"268326903485970762318815958582025440970",
"146608216884342844463727609653006817472",
"52454041172996786681917457486076416447",
"71110407748499326351911455128710240440",
"134121158576941512602948640909564362568",
"184458165097729329433236209088862073825"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45cc288724f0cfd497bb5920bcfa60caa335729",
"id": "CVE-2022-48658-b5cb4765",
"signature_version": "v1",
"target": {
"file": "mm/slub.c"
}
},
{
"digest": {
"function_hash": "243241260315654151173211410925035820757",
"length": 28.0
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df6cb39335cf5a1b918e8dbd8ba7cd9f1d00e45a",
"id": "CVE-2022-48658-bc27f1ca",
"signature_version": "v1",
"target": {
"function": "kmem_cache_init_late",
"file": "mm/slub.c"
}
},
{
"digest": {
"function_hash": "19966484360713691985485587976390776385",
"length": 548.0
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df6cb39335cf5a1b918e8dbd8ba7cd9f1d00e45a",
"id": "CVE-2022-48658-f33854d5",
"signature_version": "v1",
"target": {
"function": "flush_all_cpus_locked",
"file": "mm/slub.c"
}
}
]