In the Linux kernel, the following vulnerability has been resolved:
block: Fix potential deadlock in blkiarangesysfsshow()
When being read, a sysfs attribute is already protected against removal with the kobject node active reference counter. As a result, in blkiarangesysfsshow(), there is no need to take the queue sysfs lock when reading the value of a range attribute. Using the queue sysfs lock in this function creates a potential deadlock situation with the disk removal, something that a lockdep signals with a splat when the device is removed:
[ 760.703551] Possible unsafe locking scenario: [ 760.703551] [ 760.703554] CPU0 CPU1 [ 760.703556] ---- ---- [ 760.703558] lock(&q->sysfslock); [ 760.703565] lock(kn->active#385); [ 760.703573] lock(&q->sysfslock); [ 760.703579] lock(kn->active#385); [ 760.703587] [ 760.703587] * DEADLOCK *
Solve this by removing the mutexlock()/mutexunlock() calls from blkiarangesysfsshow().
[
{
"signature_type": "Function",
"digest": {
"function_hash": "77965036592204736118523167143917196838",
"length": 450.0
},
"target": {
"file": "block/blk-ia-ranges.c",
"function": "blk_ia_range_sysfs_show"
},
"signature_version": "v1",
"id": "CVE-2022-49406-48f0ec23",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@dc107c805cde709866b59867ef72b9390199205e"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "77965036592204736118523167143917196838",
"length": 450.0
},
"target": {
"file": "block/blk-ia-ranges.c",
"function": "blk_ia_range_sysfs_show"
},
"signature_version": "v1",
"id": "CVE-2022-49406-661ec1a4",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@717b078bc745ba9a262abebed9806a17e8bbb77b"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"73414017463862756336134409081058014258",
"48635241677974037002055132057388170203",
"293659054324754715459308111300406174224",
"63833113003385749725971258931651308068",
"37859005638558171783562960568662018527",
"183046314555697480387621179200618320042",
"266269197768711284218498078358704904381",
"11447392714587170060911471466140455297"
]
},
"target": {
"file": "block/blk-ia-ranges.c"
},
"signature_version": "v1",
"id": "CVE-2022-49406-a765b773",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@717b078bc745ba9a262abebed9806a17e8bbb77b"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"73414017463862756336134409081058014258",
"48635241677974037002055132057388170203",
"293659054324754715459308111300406174224",
"63833113003385749725971258931651308068",
"37859005638558171783562960568662018527",
"183046314555697480387621179200618320042",
"266269197768711284218498078358704904381",
"11447392714587170060911471466140455297"
]
},
"target": {
"file": "block/blk-ia-ranges.c"
},
"signature_version": "v1",
"id": "CVE-2022-49406-cd9e328c",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@41e46b3c2aa24f755b2ae9ec4ce931ba5f0d8532"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "77965036592204736118523167143917196838",
"length": 450.0
},
"target": {
"file": "block/blk-ia-ranges.c",
"function": "blk_ia_range_sysfs_show"
},
"signature_version": "v1",
"id": "CVE-2022-49406-f1629476",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@41e46b3c2aa24f755b2ae9ec4ce931ba5f0d8532"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"73414017463862756336134409081058014258",
"48635241677974037002055132057388170203",
"293659054324754715459308111300406174224",
"63833113003385749725971258931651308068",
"37859005638558171783562960568662018527",
"183046314555697480387621179200618320042",
"266269197768711284218498078358704904381",
"11447392714587170060911471466140455297"
]
},
"target": {
"file": "block/blk-ia-ranges.c"
},
"signature_version": "v1",
"id": "CVE-2022-49406-fbe8fc90",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@dc107c805cde709866b59867ef72b9390199205e"
}
]