In the Linux kernel, the following vulnerability has been resolved:
nvme-pci: fix race condition between reset and nvmedevdisable()
nvmedevdisable() modifies the dev->onlinequeues field, therefore nvmepciupdatenrqueues() should avoid racing against it, otherwise we could end up passing invalid values to blkmqupdatenrhwqueues().
WARNING: CPU: 39 PID: 61303 at drivers/pci/msi/api.c:347 pciirqgetaffinity+0x187/0x210 Workqueue: nvme-reset-wq nvmeresetwork [nvme] RIP: 0010:pciirqgetaffinity+0x187/0x210 Call Trace: <TASK> ? blkmqpcimapqueues+0x87/0x3c0 ? pciirqgetaffinity+0x187/0x210 blkmqpcimapqueues+0x87/0x3c0 nvmepcimapqueues+0x189/0x460 [nvme] blkmqupdatenrhwqueues+0x2a/0x40 nvmereset_work+0x1be/0x2a0 [nvme]
Fix the bug by locking the shutdownlock mutex before using dev->onlinequeues. Give up if nvmedevdisable() is running or if it has been executed already.
[
{
"id": "CVE-2024-50135-0fc5f77b",
"digest": {
"length": 303.0,
"function_hash": "183511437039881974944541127158812179739"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_pci_update_nr_queues"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ed32cc0939b64e3d7b48c8c0d63ea038775f304",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50135-197cf646",
"digest": {
"length": 1899.0,
"function_hash": "194929219216042870368982919622055608962"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_reset_work"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26bc0a81f64ce00fc4342c38eeb2eddaad084dd2",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50135-75bf43dc",
"digest": {
"length": 1899.0,
"function_hash": "194929219216042870368982919622055608962"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_reset_work"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ed32cc0939b64e3d7b48c8c0d63ea038775f304",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50135-93f1039a",
"digest": {
"line_hashes": [
"100793753130933420763870905715716487392",
"84665131326353228220951446890364453305",
"263529434137594965683731580863477571",
"289198149646499840910249350573584016740",
"43275991414643697542057013168777333061",
"173014259828206115711873157347850708089",
"310955255081390976969514549086526884500",
"323894695912889801282168060207741043655",
"163308389544247816709754833085789136419",
"46084956579983049068469703505889468951",
"53782194263553131075619640386465536876",
"14804028797716929479377814864725185099",
"221087197936890604288438650974337447077",
"223528928606307207697514480042035466324",
"319046128009951869641025714954890069988",
"297639704791775581725414720892851030162"
],
"threshold": 0.9
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b33e49a5f254474b33ce98fd45dd0ffdc247a0be",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50135-abe849fa",
"digest": {
"length": 303.0,
"function_hash": "183511437039881974944541127158812179739"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_pci_update_nr_queues"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26bc0a81f64ce00fc4342c38eeb2eddaad084dd2",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50135-ba619aac",
"digest": {
"line_hashes": [
"100793753130933420763870905715716487392",
"84665131326353228220951446890364453305",
"263529434137594965683731580863477571",
"289198149646499840910249350573584016740",
"43275991414643697542057013168777333061",
"173014259828206115711873157347850708089",
"310955255081390976969514549086526884500",
"323894695912889801282168060207741043655",
"163308389544247816709754833085789136419",
"46084956579983049068469703505889468951",
"53782194263553131075619640386465536876",
"14804028797716929479377814864725185099",
"221087197936890604288438650974337447077",
"223528928606307207697514480042035466324",
"319046128009951869641025714954890069988",
"297639704791775581725414720892851030162"
],
"threshold": 0.9
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ed32cc0939b64e3d7b48c8c0d63ea038775f304",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50135-d40bc40f",
"digest": {
"line_hashes": [
"100793753130933420763870905715716487392",
"84665131326353228220951446890364453305",
"263529434137594965683731580863477571",
"289198149646499840910249350573584016740",
"43275991414643697542057013168777333061",
"173014259828206115711873157347850708089",
"310955255081390976969514549086526884500",
"323894695912889801282168060207741043655",
"163308389544247816709754833085789136419",
"46084956579983049068469703505889468951",
"53782194263553131075619640386465536876",
"14804028797716929479377814864725185099",
"221087197936890604288438650974337447077",
"223528928606307207697514480042035466324",
"319046128009951869641025714954890069988",
"297639704791775581725414720892851030162"
],
"threshold": 0.9
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@26bc0a81f64ce00fc4342c38eeb2eddaad084dd2",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50135-e78d4cf9",
"digest": {
"length": 1899.0,
"function_hash": "194929219216042870368982919622055608962"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_reset_work"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b33e49a5f254474b33ce98fd45dd0ffdc247a0be",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50135-ea8116c3",
"digest": {
"length": 303.0,
"function_hash": "183511437039881974944541127158812179739"
},
"deprecated": false,
"target": {
"file": "drivers/nvme/host/pci.c",
"function": "nvme_pci_update_nr_queues"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b33e49a5f254474b33ce98fd45dd0ffdc247a0be",
"signature_version": "v1",
"signature_type": "Function"
}
]