In the Linux kernel, the following vulnerability has been resolved:
PCI: Avoid pcidevlock() AB/BA deadlock with sriovnumvfsstore()
The sysfs sriovnumvfsstore() path acquires the device lock before the config space access lock:
sriovnumvfsstore devicelock # A (1) acquire device lock sriovconfigure vfiopcisriovconfigure # (for example) vfiopcicoresriovconfigure pcidisablesriov sriovdisable pcicfgaccesslock pciwaitcfg # B (4) wait for dev->blockcfg_access == 0
Previously, pcidevlock() acquired the config space access lock before the device lock:
pcidevlock pcicfgaccesslock dev->blockcfgaccess = 1 # B (2) set dev->blockcfgaccess = 1 devicelock # A (3) wait for device lock
Any path that uses pcidevlock(), e.g., pciresetfunction(), may deadlock with sriovnumvfsstore() if the operations occur in the sequence (1) (2) (3) (4).
Avoid the deadlock by reversing the order in pcidevlock() so it acquires the device lock before the config space access lock, the same as the sriovnumvfsstore() path.
[bhelgaas: combined and adapted commit log from Jay Zhou's independent subsequent posting: https://lore.kernel.org/r/20220404062539.1710-1-jianjay.zhou@huawei.com]
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49434.json",
"cna_assigner": "Linux"
}[
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-02c00fee",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aed6d4d519210c28817948f34c53b6e058e0456c",
"digest": {
"function_hash": "290585427734486987259729083825825214313",
"length": 153.0
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-153d9025",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eff3587b9c01439b738298475e555c028ac9f55e",
"digest": {
"function_hash": "290585427734486987259729083825825214313",
"length": 153.0
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-1633f6df",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a91ee0e9fca9d7501286cfbced9b30a33e52740a",
"digest": {
"line_hashes": [
"276241090214535913731591722191769741219",
"336138885404914486474963307937293045731",
"152323663773511379370732645713901412466",
"54787249452866690798496878252452541930",
"80435282400601762049102393696884939447",
"149789977421276383093938060802427882782",
"268068777618764421051787747067115786900",
"13141537847091498404068575083207303164",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"10982712135636559960759105468274716109",
"206874585201777163527448994472769785719",
"210640824829026783645068148352525725166",
"157440880376813963520465273140024587795",
"8754845036686962865086763195914306673"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-16f1cb17",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ea047f51172aa68841adef7f52d375002438b8f0",
"digest": {
"line_hashes": [
"276241090214535913731591722191769741219",
"336138885404914486474963307937293045731",
"152323663773511379370732645713901412466",
"54787249452866690798496878252452541930",
"80435282400601762049102393696884939447",
"149789977421276383093938060802427882782",
"268068777618764421051787747067115786900",
"13141537847091498404068575083207303164",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"10982712135636559960759105468274716109",
"206874585201777163527448994472769785719",
"210640824829026783645068148352525725166",
"157440880376813963520465273140024587795",
"8754845036686962865086763195914306673"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-1f793673",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2cdd5284035322795b0964f899eefba254cfe483",
"digest": {
"line_hashes": [
"199678516603632756512704374636794711944",
"260959095875664427542224551676846732944",
"152323663773511379370732645713901412466",
"21842728120311364751274927283328189537",
"258393813934691137426903075843946571434",
"337071711419175871907438879321987652544",
"13141537847091498404068575083207303164",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"10982712135636559960759105468274716109",
"206874585201777163527448994472769785719",
"210640824829026783645068148352525725166",
"157440880376813963520465273140024587795",
"8754845036686962865086763195914306673"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-2f01c3ec",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3c6dc1853b8bf3c718f96fd8480a6eb09ba4831",
"digest": {
"function_hash": "290585427734486987259729083825825214313",
"length": 153.0
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-43b589c3",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eff3587b9c01439b738298475e555c028ac9f55e",
"digest": {
"line_hashes": [
"199678516603632756512704374636794711944",
"260959095875664427542224551676846732944",
"152323663773511379370732645713901412466",
"202168390757472864351113778914678945855",
"22092029491689236100962086839573200859",
"199200501557175931623732718673608665335",
"114141377544992263256766344345220832664",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"97735861911657950565471329468146242537",
"144361439948589723947566616915372628292",
"210640824829026783645068148352525725166",
"45420268058724381024426817082629330959",
"13373495804500831170649784015656162648"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-442162da",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3c6dc1853b8bf3c718f96fd8480a6eb09ba4831",
"digest": {
"line_hashes": [
"199678516603632756512704374636794711944",
"260959095875664427542224551676846732944",
"152323663773511379370732645713901412466",
"202168390757472864351113778914678945855",
"22092029491689236100962086839573200859",
"199200501557175931623732718673608665335",
"114141377544992263256766344345220832664",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"97735861911657950565471329468146242537",
"144361439948589723947566616915372628292",
"210640824829026783645068148352525725166",
"45420268058724381024426817082629330959",
"13373495804500831170649784015656162648"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-4b7d7ea5",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aed6d4d519210c28817948f34c53b6e058e0456c",
"digest": {
"line_hashes": [
"199678516603632756512704374636794711944",
"260959095875664427542224551676846732944",
"152323663773511379370732645713901412466",
"202168390757472864351113778914678945855",
"22092029491689236100962086839573200859",
"199200501557175931623732718673608665335",
"114141377544992263256766344345220832664",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"97735861911657950565471329468146242537",
"144361439948589723947566616915372628292",
"210640824829026783645068148352525725166",
"45420268058724381024426817082629330959",
"13373495804500831170649784015656162648"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_lock"
},
"id": "CVE-2022-49434-4fe2c21b",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2cdd5284035322795b0964f899eefba254cfe483",
"digest": {
"function_hash": "77023796228698311723792533250141770107",
"length": 96.0
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-7153a8ed",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ea047f51172aa68841adef7f52d375002438b8f0",
"digest": {
"function_hash": "36094299141296079534524600064588590568",
"length": 146.0
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-7b7e3e4a",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2cdd5284035322795b0964f899eefba254cfe483",
"digest": {
"function_hash": "36094299141296079534524600064588590568",
"length": 146.0
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-7d3bac14",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9a81f9ed6ae3554621d6a50220b1bc74b67d81e",
"digest": {
"function_hash": "290585427734486987259729083825825214313",
"length": 153.0
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-95456b6a",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a91ee0e9fca9d7501286cfbced9b30a33e52740a",
"digest": {
"function_hash": "36094299141296079534524600064588590568",
"length": 146.0
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-bd73342e",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59ea6b3ae51df7cd6bfd84c9c0030609b9315622",
"digest": {
"line_hashes": [
"276241090214535913731591722191769741219",
"336138885404914486474963307937293045731",
"152323663773511379370732645713901412466",
"54787249452866690798496878252452541930",
"80435282400601762049102393696884939447",
"149789977421276383093938060802427882782",
"268068777618764421051787747067115786900",
"13141537847091498404068575083207303164",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"10982712135636559960759105468274716109",
"206874585201777163527448994472769785719",
"210640824829026783645068148352525725166",
"157440880376813963520465273140024587795",
"8754845036686962865086763195914306673"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c"
},
"id": "CVE-2022-49434-f0fec830",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9a81f9ed6ae3554621d6a50220b1bc74b67d81e",
"digest": {
"line_hashes": [
"199678516603632756512704374636794711944",
"260959095875664427542224551676846732944",
"152323663773511379370732645713901412466",
"202168390757472864351113778914678945855",
"22092029491689236100962086839573200859",
"199200501557175931623732718673608665335",
"114141377544992263256766344345220832664",
"81283384178100364721054039946510644990",
"113322208342721423193487704170768152175",
"225060414703705315739834849167857479107",
"52472299039791266148211279099678246082",
"275705568833908430827758707908755616168",
"97735861911657950565471329468146242537",
"144361439948589723947566616915372628292",
"210640824829026783645068148352525725166",
"45420268058724381024426817082629330959",
"13373495804500831170649784015656162648"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"file": "drivers/pci/pci.c",
"function": "pci_dev_trylock"
},
"id": "CVE-2022-49434-f6db6caf",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59ea6b3ae51df7cd6bfd84c9c0030609b9315622",
"digest": {
"function_hash": "36094299141296079534524600064588590568",
"length": 146.0
}
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49434.json"