In the Linux kernel, the following vulnerability has been resolved:
gpio: amd8111: Fix PCI device reference count leak
foreachpcidev() is implemented by pcigetdevice(). The comment of pcigetdevice() says that it will increase the reference count for the returned pcidev and also decrease the reference count for the input pci_dev @from if it is not NULL.
If we break foreachpcidev() loop with pdev not NULL, we need to call pcidevput() to decrease the reference count. Add the missing pcidevput() after the 'out' label. Since pcidevput() can handle NULL input parameter, there is no problem for the 'Device not found' branch. For the normal path, add pcidevput() in amdgpio_exit().
[
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"256832859778528065074036094640189253686",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-019ad1af",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ee6413d3dd972930af787b2c0c7aaeb379fa521"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "54885877550003989136572846977125122938",
"length": 1077.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-10c22d58",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e364ce04d8f840478b09eee57b614de7cf1e743e"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-1d4e2d2d",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ee6413d3dd972930af787b2c0c7aaeb379fa521"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "147796485549525098902898780380450713131",
"length": 1062.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-27a31cec",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2bc053ebbba57a06fa655db5ea796de2edce445"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"256832859778528065074036094640189253686",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-37e1e3db",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48bd5d3801f6b67cc144449d434abbd5043a6d37"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"256832859778528065074036094640189253686",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-4636594d",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71d591ef873f9ebb86cd8d053b3caee785b2de6a"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-4a9f5a9a",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2bc053ebbba57a06fa655db5ea796de2edce445"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"151482954770073226519898261897319451004",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-599857c6",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4271515f189bd5fe2ec86b4089dab7cb804625d2"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "147796485549525098902898780380450713131",
"length": 1062.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-5d45fc61",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4749c5cc147c9860b96db1e71cc36d1de1bd3f59"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "147796485549525098902898780380450713131",
"length": 1062.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-60411655",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48bd5d3801f6b67cc144449d434abbd5043a6d37"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"151482954770073226519898261897319451004",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-652757c3",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45fecdb9f658d9c82960c98240bc0770ade19aca"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "147796485549525098902898780380450713131",
"length": 1062.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-785feefe",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5ee6413d3dd972930af787b2c0c7aaeb379fa521"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "147796485549525098902898780380450713131",
"length": 1062.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-93f822ec",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71d591ef873f9ebb86cd8d053b3caee785b2de6a"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"256832859778528065074036094640189253686",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-94138f6b",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4749c5cc147c9860b96db1e71cc36d1de1bd3f59"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-a4948885",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45fecdb9f658d9c82960c98240bc0770ade19aca"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-a5009c97",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71d591ef873f9ebb86cd8d053b3caee785b2de6a"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-afa7c84b",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48bd5d3801f6b67cc144449d434abbd5043a6d37"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "54885877550003989136572846977125122938",
"length": 1077.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-c12b5235",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@45fecdb9f658d9c82960c98240bc0770ade19aca"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-c1fec40f",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4271515f189bd5fe2ec86b4089dab7cb804625d2"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "54885877550003989136572846977125122938",
"length": 1077.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_init"
},
"signature_version": "v1",
"id": "CVE-2022-48973-d6dc8e3a",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4271515f189bd5fe2ec86b4089dab7cb804625d2"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-d9339e97",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4749c5cc147c9860b96db1e71cc36d1de1bd3f59"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"256832859778528065074036094640189253686",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-dd4fbdaa",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b2bc053ebbba57a06fa655db5ea796de2edce445"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "118092964042613817509803876354958184485",
"length": 85.0
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c",
"function": "amd_gpio_exit"
},
"signature_version": "v1",
"id": "CVE-2022-48973-fcc71cf8",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e364ce04d8f840478b09eee57b614de7cf1e743e"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"151482954770073226519898261897319451004",
"81750837403051794961323532140459875438",
"328180880228305975693791049645817278486",
"191470593851672364273264376911613874509",
"80646918054542875790327015300495266981",
"109540991815091730496970525351499608431",
"182054729845075520003123140538999938955",
"180349858790221278204171068064406833773",
"189192814830267774566246531390944793214"
]
},
"target": {
"file": "drivers/gpio/gpio-amd8111.c"
},
"signature_version": "v1",
"id": "CVE-2022-48973-fe965a90",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e364ce04d8f840478b09eee57b614de7cf1e743e"
}
]