CVE-2022-48812

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48812
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48812.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48812
Downstream
Related
Published
2024-07-16T11:44:01Z
Modified
2025-10-08T06:15:26.919622Z
Summary
net: dsa: lantiq_gswip: don't use devres for mdiobus
Details

In the Linux kernel, the following vulnerability has been resolved:

net: dsa: lantiq_gswip: don't use devres for mdiobus

As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slavemiibus using devres")

mdiobusfree() will panic when called from devmmdiobusfree() <- devresreleaseall() <- _devicereleasedriver(), and that mdiobus was not previously unregistered.

The GSWIP switch is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here.

If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and devicelinksunbind_consumers() will unbind the GSWIP switch driver on shutdown.

So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all.

The gswip driver has the code structure in place for orderly mdiobus removal, so just replace devmmdiobusalloc() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
e177d2e85ebcd3008c4b2abc293f4118e04eedef
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
b5652bc50dde7b84e93dfb25479b64b817e377c1
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
2443ba2fe396bdde187a2fdfa6a57375643ae93c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
0d120dfb5d67edc5bcd1804e167dba2b30809afd

Affected versions

v5.*

v5.10
v5.10-rc1
v5.10-rc2
v5.10-rc3
v5.10-rc4
v5.10-rc5
v5.10-rc6
v5.10-rc7
v5.10.1
v5.10.10
v5.10.100
v5.10.11
v5.10.12
v5.10.13
v5.10.14
v5.10.15
v5.10.16
v5.10.17
v5.10.18
v5.10.19
v5.10.2
v5.10.20
v5.10.21
v5.10.22
v5.10.23
v5.10.24
v5.10.25
v5.10.26
v5.10.27
v5.10.28
v5.10.29
v5.10.3
v5.10.30
v5.10.31
v5.10.32
v5.10.33
v5.10.34
v5.10.35
v5.10.36
v5.10.37
v5.10.38
v5.10.39
v5.10.4
v5.10.40
v5.10.41
v5.10.42
v5.10.43
v5.10.44
v5.10.45
v5.10.46
v5.10.47
v5.10.48
v5.10.49
v5.10.5
v5.10.50
v5.10.51
v5.10.52
v5.10.53
v5.10.54
v5.10.55
v5.10.56
v5.10.57
v5.10.58
v5.10.59
v5.10.6
v5.10.60
v5.10.61
v5.10.62
v5.10.63
v5.10.64
v5.10.65
v5.10.66
v5.10.67
v5.10.68
v5.10.69
v5.10.7
v5.10.70
v5.10.71
v5.10.72
v5.10.73
v5.10.74
v5.10.75
v5.10.76
v5.10.77
v5.10.78
v5.10.79
v5.10.8
v5.10.80
v5.10.81
v5.10.82
v5.10.83
v5.10.84
v5.10.85
v5.10.86
v5.10.87
v5.10.88
v5.10.89
v5.10.9
v5.10.90
v5.10.91
v5.10.92
v5.10.93
v5.10.94
v5.10.95
v5.10.96
v5.10.97
v5.10.98
v5.10.99
v5.11
v5.11-rc1
v5.11-rc2
v5.11-rc3
v5.11-rc4
v5.11-rc5
v5.11-rc6
v5.11-rc7
v5.12
v5.12-rc1
v5.12-rc1-dontuse
v5.12-rc2
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.3
v5.15.4
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17-rc1
v5.17-rc2
v5.8
v5.8-rc3
v5.8-rc4
v5.8-rc5
v5.8-rc6
v5.8-rc7
v5.9
v5.9-rc1
v5.9-rc2
v5.9-rc3
v5.9-rc4
v5.9-rc5
v5.9-rc6
v5.9-rc7
v5.9-rc8

Database specific

{
    "vanir_signatures": [
        {
            "signature_version": "v1",
            "digest": {
                "length": 429.0,
                "function_hash": "170329641908675948590876715782799474142"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e177d2e85ebcd3008c4b2abc293f4118e04eedef",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_remove"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-11dd66f8"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 2669.0,
                "function_hash": "139877796109209585112125122163024274793"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d120dfb5d67edc5bcd1804e167dba2b30809afd",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_probe"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-27edb31e"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 632.0,
                "function_hash": "96730017608033888441913164998371461498"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e177d2e85ebcd3008c4b2abc293f4118e04eedef",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_mdio"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-2811c1f4"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 2669.0,
                "function_hash": "139877796109209585112125122163024274793"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2443ba2fe396bdde187a2fdfa6a57375643ae93c",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_probe"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-4a1803dc"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 632.0,
                "function_hash": "96730017608033888441913164998371461498"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d120dfb5d67edc5bcd1804e167dba2b30809afd",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_mdio"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-936c19fd"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "149947293352453308415914284224957544158",
                    "312087621675449370992849850779596066243",
                    "313093489064340872225578775567978095703",
                    "255625506610195040158704565428057967280",
                    "72340868919128208500986685434712646387",
                    "241473608930832608666800619000336363330",
                    "329802262471271122607046953351180340889",
                    "140121862155831761646538499884080554886",
                    "102938626405535547581175163107815896280",
                    "63028485553913004037180853960090131358",
                    "218555978078543789127235843926436981755",
                    "223471859341406704481269779769461793552",
                    "303321300439178638013149746421247177266",
                    "58064371621715390636153836351167270390",
                    "254155837574345592420057708752808917846",
                    "94423635000645630573559282739086890366",
                    "206367568301294184087549704377794874230",
                    "229263394641608795939602932352169551636"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b5652bc50dde7b84e93dfb25479b64b817e377c1",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48812-9d940f15"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 481.0,
                "function_hash": "128386158841411029526816529585631631213"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2443ba2fe396bdde187a2fdfa6a57375643ae93c",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_remove"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-a0b05e33"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 481.0,
                "function_hash": "128386158841411029526816529585631631213"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b5652bc50dde7b84e93dfb25479b64b817e377c1",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_remove"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-a56b3f58"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "149947293352453308415914284224957544158",
                    "312087621675449370992849850779596066243",
                    "313093489064340872225578775567978095703",
                    "255625506610195040158704565428057967280",
                    "72340868919128208500986685434712646387",
                    "241473608930832608666800619000336363330",
                    "329802262471271122607046953351180340889",
                    "140121862155831761646538499884080554886",
                    "102938626405535547581175163107815896280",
                    "63028485553913004037180853960090131358",
                    "218555978078543789127235843926436981755",
                    "223471859341406704481269779769461793552",
                    "303321300439178638013149746421247177266",
                    "58064371621715390636153836351167270390",
                    "254155837574345592420057708752808917846",
                    "94423635000645630573559282739086890366",
                    "206367568301294184087549704377794874230",
                    "229263394641608795939602932352169551636"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e177d2e85ebcd3008c4b2abc293f4118e04eedef",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48812-ad1a1e57"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 632.0,
                "function_hash": "96730017608033888441913164998371461498"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2443ba2fe396bdde187a2fdfa6a57375643ae93c",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_mdio"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-b21995d4"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 481.0,
                "function_hash": "128386158841411029526816529585631631213"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d120dfb5d67edc5bcd1804e167dba2b30809afd",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_remove"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-b44b2e81"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 2190.0,
                "function_hash": "298819590009274490505256671796440988589"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e177d2e85ebcd3008c4b2abc293f4118e04eedef",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_probe"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-bb28181d"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "149947293352453308415914284224957544158",
                    "312087621675449370992849850779596066243",
                    "313093489064340872225578775567978095703",
                    "255625506610195040158704565428057967280",
                    "72340868919128208500986685434712646387",
                    "241473608930832608666800619000336363330",
                    "329802262471271122607046953351180340889",
                    "140121862155831761646538499884080554886",
                    "102938626405535547581175163107815896280",
                    "63028485553913004037180853960090131358",
                    "218555978078543789127235843926436981755",
                    "223471859341406704481269779769461793552",
                    "303321300439178638013149746421247177266",
                    "58064371621715390636153836351167270390",
                    "254155837574345592420057708752808917846",
                    "94423635000645630573559282739086890366",
                    "206367568301294184087549704377794874230",
                    "229263394641608795939602932352169551636"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2443ba2fe396bdde187a2fdfa6a57375643ae93c",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48812-bb87aff1"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 632.0,
                "function_hash": "96730017608033888441913164998371461498"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b5652bc50dde7b84e93dfb25479b64b817e377c1",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_mdio"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-bdb3dd6b"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "149947293352453308415914284224957544158",
                    "312087621675449370992849850779596066243",
                    "313093489064340872225578775567978095703",
                    "255625506610195040158704565428057967280",
                    "72340868919128208500986685434712646387",
                    "241473608930832608666800619000336363330",
                    "329802262471271122607046953351180340889",
                    "140121862155831761646538499884080554886",
                    "102938626405535547581175163107815896280",
                    "63028485553913004037180853960090131358",
                    "218555978078543789127235843926436981755",
                    "223471859341406704481269779769461793552",
                    "303321300439178638013149746421247177266",
                    "58064371621715390636153836351167270390",
                    "254155837574345592420057708752808917846",
                    "94423635000645630573559282739086890366",
                    "206367568301294184087549704377794874230",
                    "229263394641608795939602932352169551636"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0d120dfb5d67edc5bcd1804e167dba2b30809afd",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48812-cd7a0ba3"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 2630.0,
                "function_hash": "188034889008497335131997822918236354557"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b5652bc50dde7b84e93dfb25479b64b817e377c1",
            "deprecated": false,
            "target": {
                "file": "drivers/net/dsa/lantiq_gswip.c",
                "function": "gswip_probe"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48812-e1435dab"
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.9.0
Fixed
5.10.101
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.24
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.10