CVE-2022-48808

Source
https://cve.org/CVERecord?id=CVE-2022-48808
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48808.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48808
Downstream
Related
Published
2024-07-16T11:43:59.089Z
Modified
2026-03-14T11:56:20.328858Z
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 callnetdevicenotifiers_info+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 device_shutdown+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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48808.json"
}
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
Fixed
89b60402d43cdab4387dbbf24afebda5cf092ae7
Fixed
ee534378f00561207656663d93907583958339ae

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48808.json"