CVE-2022-48808

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48808
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48808.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48808
Downstream
Related
Published
2024-07-16T11:43:59Z
Modified
2025-10-08T06:09:24.550512Z
Summary
net: dsa: fix panic when DSA master device unbinds on shutdown
Details

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

net: dsa: fix panic when DSA master device unbinds on shutdown

Rafael reports that on a system with LX2160A and Marvell DSA switches, if a reboot occurs while the DSA master (dpaa2-eth) is up, the following panic can be seen:

systemd-shutdown[1]: Rebooting. Unable to handle kernel paging request at virtual address 00a0000800000041 [00a0000800000041] address between user and kernel address ranges Internal error: Oops: 96000004 [#1] PREEMPT SMP CPU: 6 PID: 1 Comm: systemd-shutdow Not tainted 5.16.5-00042-g8f5585009b24 #32 pc : dsaslavenetdeviceevent+0x130/0x3e4 lr : rawnotifiercallchain+0x50/0x6c Call trace: dsaslavenetdeviceevent+0x130/0x3e4 rawnotifiercallchain+0x50/0x6c callnetdevicenotifiersinfo+0x54/0xa0 _devclosemany+0x50/0x130 devclosemany+0x84/0x120 unregisternetdevicemany+0x130/0x710 unregisternetdevicequeue+0x8c/0xd0 unregisternetdev+0x20/0x30 dpaa2ethremove+0x68/0x190 fslmcdriverremove+0x20/0x5c _devicereleasedriver+0x21c/0x220 devicereleasedriverinternal+0xac/0xb0 devicelinksunbindconsumers+0xd4/0x100 _devicereleasedriver+0x94/0x220 devicereleasedriver+0x28/0x40 busremovedevice+0x118/0x124 devicedel+0x174/0x420 fslmcdeviceremove+0x24/0x40 _fslmcdeviceremove+0xc/0x20 deviceforeachchild+0x58/0xa0 dprcremove+0x90/0xb0 fslmcdriverremove+0x20/0x5c _devicereleasedriver+0x21c/0x220 devicereleasedriver+0x28/0x40 busremovedevice+0x118/0x124 devicedel+0x174/0x420 fslmcbusremove+0x80/0x100 fslmcbusshutdown+0xc/0x1c platformshutdown+0x20/0x30 deviceshutdown+0x154/0x330 _dosysreboot+0x1cc/0x250 _arm64sysreboot+0x20/0x30 invokesyscall.constprop.0+0x4c/0xe0 doel0svc+0x4c/0x150 el0svc+0x24/0xb0 el0t64synchandler+0xa8/0xb0 el0t64sync+0x178/0x17c

It can be seen from the stack trace that the problem is that the deregistration of the master causes a devclose(), which gets notified as NETDEVGOINGDOWN to dsaslavenetdeviceevent(). But dsaswitchshutdown() has already run, and this has unregistered the DSA slave interfaces, and yet, the NETDEVGOINGDOWN handler attempts to call devclosemany() on those slave interfaces, leading to the problem.

The previous attempt to avoid the NETDEVGOINGDOWN on the master after dsaswitchshutdown() was called seems improper. Unregistering the slave interfaces is unnecessary and unhelpful. Instead, after the slaves have stopped being uppers of the DSA master, we can now reset to NULL the master->dsa_ptr pointer, which will make DSA start ignoring all future notifier events on the master.

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
0650bf52b31ff35dc6430fc2e37969c36baba724
Fixed
ff45899e732e57088985e3a497b1d9100571c0f5
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0650bf52b31ff35dc6430fc2e37969c36baba724
Fixed
89b60402d43cdab4387dbbf24afebda5cf092ae7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0650bf52b31ff35dc6430fc2e37969c36baba724
Fixed
ee534378f00561207656663d93907583958339ae

Affected versions

v5.*

v5.15
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.100
v5.15.101
v5.15.102
v5.15.103
v5.15.104
v5.15.105
v5.15.106
v5.15.107
v5.15.108
v5.15.109
v5.15.11
v5.15.110
v5.15.111
v5.15.112
v5.15.113
v5.15.114
v5.15.115
v5.15.116
v5.15.117
v5.15.118
v5.15.119
v5.15.12
v5.15.120
v5.15.121
v5.15.122
v5.15.123
v5.15.124
v5.15.125
v5.15.126
v5.15.127
v5.15.128
v5.15.129
v5.15.13
v5.15.130
v5.15.131
v5.15.132
v5.15.133
v5.15.134
v5.15.135
v5.15.136
v5.15.137
v5.15.138
v5.15.139
v5.15.14
v5.15.140
v5.15.141
v5.15.142
v5.15.143
v5.15.144
v5.15.145
v5.15.146
v5.15.147
v5.15.148
v5.15.149
v5.15.15
v5.15.150
v5.15.151
v5.15.152
v5.15.153
v5.15.154
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.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.33
v5.15.34
v5.15.35
v5.15.36
v5.15.37
v5.15.38
v5.15.39
v5.15.4
v5.15.40
v5.15.41
v5.15.42
v5.15.43
v5.15.44
v5.15.45
v5.15.46
v5.15.47
v5.15.48
v5.15.49
v5.15.5
v5.15.50
v5.15.51
v5.15.52
v5.15.53
v5.15.54
v5.15.55
v5.15.56
v5.15.57
v5.15.58
v5.15.59
v5.15.6
v5.15.60
v5.15.61
v5.15.62
v5.15.63
v5.15.64
v5.15.65
v5.15.66
v5.15.67
v5.15.68
v5.15.69
v5.15.7
v5.15.70
v5.15.71
v5.15.72
v5.15.73
v5.15.74
v5.15.75
v5.15.76
v5.15.77
v5.15.78
v5.15.79
v5.15.8
v5.15.80
v5.15.81
v5.15.82
v5.15.83
v5.15.84
v5.15.85
v5.15.86
v5.15.87
v5.15.88
v5.15.89
v5.15.9
v5.15.90
v5.15.91
v5.15.92
v5.15.93
v5.15.94
v5.15.95
v5.15.96
v5.15.97
v5.15.98
v5.15.99
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

Database specific

{
    "vanir_signatures": [
        {
            "id": "CVE-2022-48808-2d689625",
            "deprecated": false,
            "digest": {
                "function_hash": "298063074322660650986656955803261262471",
                "length": 386.0
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89b60402d43cdab4387dbbf24afebda5cf092ae7",
            "target": {
                "file": "net/dsa/dsa2.c",
                "function": "dsa_switch_shutdown"
            },
            "signature_type": "Function",
            "signature_version": "v1"
        },
        {
            "id": "CVE-2022-48808-72020507",
            "deprecated": false,
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "138405783168094727254987479107571533098",
                    "309839991120751703632947939326591247412",
                    "210632535381881662762415043039756448608",
                    "279024351330477795456706063123674875604",
                    "163441317831938894187301842863679705428",
                    "50601614822967011622111503688253943592",
                    "311092935074000718194327403673358577231",
                    "17821653169026793621771339024601698148",
                    "169381736009314959873897396628872929822",
                    "64825776503570771889731288760082124380"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ff45899e732e57088985e3a497b1d9100571c0f5",
            "target": {
                "file": "net/dsa/dsa2.c"
            },
            "signature_type": "Line",
            "signature_version": "v1"
        },
        {
            "id": "CVE-2022-48808-9915cdb3",
            "deprecated": false,
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "138405783168094727254987479107571533098",
                    "309839991120751703632947939326591247412",
                    "210632535381881662762415043039756448608",
                    "319567773091961345132614654407611923346",
                    "163441317831938894187301842863679705428",
                    "50601614822967011622111503688253943592",
                    "311092935074000718194327403673358577231",
                    "17821653169026793621771339024601698148",
                    "315069441411618060499020244297520945394",
                    "5785113095398761090993859827011198946"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ee534378f00561207656663d93907583958339ae",
            "target": {
                "file": "net/dsa/dsa2.c"
            },
            "signature_type": "Line",
            "signature_version": "v1"
        },
        {
            "id": "CVE-2022-48808-b903e657",
            "deprecated": false,
            "digest": {
                "function_hash": "331266948589989009917887178392553191914",
                "length": 519.0
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ff45899e732e57088985e3a497b1d9100571c0f5",
            "target": {
                "file": "net/dsa/dsa2.c",
                "function": "dsa_switch_shutdown"
            },
            "signature_type": "Function",
            "signature_version": "v1"
        },
        {
            "id": "CVE-2022-48808-bd8b812f",
            "deprecated": false,
            "digest": {
                "function_hash": "298063074322660650986656955803261262471",
                "length": 386.0
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ee534378f00561207656663d93907583958339ae",
            "target": {
                "file": "net/dsa/dsa2.c",
                "function": "dsa_switch_shutdown"
            },
            "signature_type": "Function",
            "signature_version": "v1"
        },
        {
            "id": "CVE-2022-48808-c5bbe71a",
            "deprecated": false,
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "138405783168094727254987479107571533098",
                    "309839991120751703632947939326591247412",
                    "210632535381881662762415043039756448608",
                    "319567773091961345132614654407611923346",
                    "163441317831938894187301842863679705428",
                    "50601614822967011622111503688253943592",
                    "311092935074000718194327403673358577231",
                    "17821653169026793621771339024601698148",
                    "315069441411618060499020244297520945394",
                    "5785113095398761090993859827011198946"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89b60402d43cdab4387dbbf24afebda5cf092ae7",
            "target": {
                "file": "net/dsa/dsa2.c"
            },
            "signature_type": "Line",
            "signature_version": "v1"
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.15.0
Fixed
5.15.155
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.10