CVE-2022-48817

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48817
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48817.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48817
Downstream
Related
Published
2024-07-16T11:44:05Z
Modified
2025-10-08T06:21:26.090628Z
Summary
net: dsa: ar9331: register the mdiobus under devres
Details

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

net: dsa: ar9331: register the mdiobus under devres

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 ar9331 is an MDIO 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 ar9331 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 ar9331 driver doesn't have a complex code structure for mdiobus removal, so just replace ofmdiobusregister with the devres variant in order to be all-devres and ensure that we don't 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
475ce5dcf2d88fd4f3c213a0ac944e3e40702970
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
aae1c6a1d3d696fc33b609fb12fe744a556d1dc5
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
f1842a8cb71de4d7eb75a86f76e88c7ee739218c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ac3a68d56651c3dad2c12c7afce065fe15267f44
Fixed
50facd86e9fbc4b93fe02e5fe05776047f45dbfb

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": [
        {
            "digest": {
                "length": 204.0,
                "function_hash": "7231237077957827107151215927744140165"
            },
            "id": "CVE-2022-48817-0132b746",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_remove",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@475ce5dcf2d88fd4f3c213a0ac944e3e40702970"
        },
        {
            "digest": {
                "length": 580.0,
                "function_hash": "226240037260468495952872603763880223239"
            },
            "id": "CVE-2022-48817-06f1778b",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_mbus_init",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aae1c6a1d3d696fc33b609fb12fe744a556d1dc5"
        },
        {
            "digest": {
                "length": 580.0,
                "function_hash": "226240037260468495952872603763880223239"
            },
            "id": "CVE-2022-48817-20f0659b",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_mbus_init",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@475ce5dcf2d88fd4f3c213a0ac944e3e40702970"
        },
        {
            "digest": {
                "line_hashes": [
                    "231367425530815438675887440976515825811",
                    "70403573786930730520234647430218644250",
                    "46589036113819385946703615198017756140",
                    "169214330075990309672359967329087787884",
                    "146665029218251157510983817798038865804",
                    "56287902735845047959224707311076872884",
                    "124061259227070548761827738987966707392",
                    "163120402612153368584690670889513091829"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2022-48817-26946d1c",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Line",
            "target": {
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aae1c6a1d3d696fc33b609fb12fe744a556d1dc5"
        },
        {
            "digest": {
                "line_hashes": [
                    "231367425530815438675887440976515825811",
                    "70403573786930730520234647430218644250",
                    "46589036113819385946703615198017756140",
                    "169214330075990309672359967329087787884",
                    "146665029218251157510983817798038865804",
                    "56287902735845047959224707311076872884",
                    "124061259227070548761827738987966707392",
                    "163120402612153368584690670889513091829"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2022-48817-30028e19",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Line",
            "target": {
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50facd86e9fbc4b93fe02e5fe05776047f45dbfb"
        },
        {
            "digest": {
                "length": 580.0,
                "function_hash": "226240037260468495952872603763880223239"
            },
            "id": "CVE-2022-48817-527225c8",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_mbus_init",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1842a8cb71de4d7eb75a86f76e88c7ee739218c"
        },
        {
            "digest": {
                "length": 415.0,
                "function_hash": "312312815375432954020393021779453694875"
            },
            "id": "CVE-2022-48817-5cfb6d60",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_remove",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50facd86e9fbc4b93fe02e5fe05776047f45dbfb"
        },
        {
            "digest": {
                "length": 415.0,
                "function_hash": "312312815375432954020393021779453694875"
            },
            "id": "CVE-2022-48817-5fceb73b",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_remove",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1842a8cb71de4d7eb75a86f76e88c7ee739218c"
        },
        {
            "digest": {
                "line_hashes": [
                    "231367425530815438675887440976515825811",
                    "70403573786930730520234647430218644250",
                    "46589036113819385946703615198017756140",
                    "169214330075990309672359967329087787884",
                    "146665029218251157510983817798038865804",
                    "56287902735845047959224707311076872884",
                    "124061259227070548761827738987966707392",
                    "163120402612153368584690670889513091829"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2022-48817-6e8ee06a",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Line",
            "target": {
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1842a8cb71de4d7eb75a86f76e88c7ee739218c"
        },
        {
            "digest": {
                "length": 580.0,
                "function_hash": "226240037260468495952872603763880223239"
            },
            "id": "CVE-2022-48817-9109ab73",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_mbus_init",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50facd86e9fbc4b93fe02e5fe05776047f45dbfb"
        },
        {
            "digest": {
                "length": 415.0,
                "function_hash": "312312815375432954020393021779453694875"
            },
            "id": "CVE-2022-48817-d93c231e",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Function",
            "target": {
                "function": "ar9331_sw_remove",
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aae1c6a1d3d696fc33b609fb12fe744a556d1dc5"
        },
        {
            "digest": {
                "line_hashes": [
                    "231367425530815438675887440976515825811",
                    "70403573786930730520234647430218644250",
                    "46589036113819385946703615198017756140",
                    "169214330075990309672359967329087787884",
                    "41682798665848323502815982770592835477",
                    "62060266260075733663226148395929647724",
                    "124061259227070548761827738987966707392",
                    "58496139071098231314338916449566501558"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2022-48817-fb749e41",
            "signature_version": "v1",
            "deprecated": false,
            "signature_type": "Line",
            "target": {
                "file": "drivers/net/dsa/qca/ar9331.c"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@475ce5dcf2d88fd4f3c213a0ac944e3e40702970"
        }
    ]
}

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