CVE-2023-54149

Source
https://cve.org/CVERecord?id=CVE-2023-54149
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-54149.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-54149
Downstream
Related
Published
2025-12-24T13:07:00.977Z
Modified
2026-04-02T09:45:38.033865Z
Summary
net: dsa: avoid suspicious RCU usage for synced VLAN-aware MAC addresses
Details

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

net: dsa: avoid suspicious RCU usage for synced VLAN-aware MAC addresses

When using the felix driver (the only one which supports UC filtering and MC filtering) as a DSA master for a random other DSA switch, one can see the following stack trace when the downstream switch ports join a VLAN-aware bridge:

=============================

WARNING: suspicious RCU usage

net/8021q/vlancore.c:238 suspicious rcudereference_protected() usage!

stack backtrace: Workqueue: dsaordered dsaslaveswitchdeveventwork Call trace: lockdeprcususpicious+0x170/0x210 vlanforeach+0x8c/0x188 dsaslavesyncuc+0x128/0x178 __hwaddrsync_dev+0x138/0x158 dsaslavesetrxmode+0x58/0x70 __devsetrxmode+0x88/0xa8 devucadd+0x74/0xa0 dsaportbridgehostfdbadd+0xec/0x180 dsaslaveswitchdeveventwork+0x7c/0x1c8 processonework+0x290/0x568

What it's saying is that vlanforeach() expects rtnllock() context and it's not getting it, when it's called from the DSA master's ndosetrxmode().

The caller of that - dsaslavesetrxmode() - is the slave DSA interface's dsaportbridgehostfdbadd() which comes from the deferred dsaslaveswitchdevevent_work().

We went to great lengths to avoid the rtnllock() context in that call path in commit 0faf890fc519 ("net: dsa: drop rtnllock from dsaslaveswitchdeveventwork"), and calling rtnllock() is simply not an option due to the possibility of deadlocking when calling dsaflushworkqueue() from the call paths that do hold rtnllock() - basically all of them.

So, when the DSA master calls vlanforeach() from its ndosetrx_mode(), the state of the 8021q driver on this device is really not protected from concurrent access by anything.

Looking at net/8021q/, I don't think that vlaninfo->vidlist was particularly designed with RCU traversal in mind, so introducing an RCU read-side form of vlanforeach() - vlanforeach_rcu() - won't be so easy, and it also wouldn't be exactly what we need anyway.

In general I believe that the solution isn't in net/8021q/ anyway; vlanforeach() is not cut out for this task. DSA doesn't need rtnllock() to be held per se - since it's not a netdev state change that we're blocking, but rather, just concurrent additions/removals to a VLAN list. We don't even need sleepable context - the callback of vlanfor_each() just schedules deferred work.

The proposed escape is to remove the dependency on vlanforeach() and to open-code a non-sleepable, rtnl-free alternative to that, based on copies of the VLAN list modified from .ndovlanrxaddvid() and .ndovlanrxkillvid().

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54149.json",
    "cna_assigner": "Linux"
}
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
64fdc5f341db01200e33105265d4b8450122a82e
Fixed
3948c69b3837fec2ee5a90fbc911c343199be0ac
Fixed
3f9e79f31e51b7d5bf95c617540deb6cf2816a3f
Fixed
d06f925f13976ab82167c93467c70a337a0a3cda
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
2daf967a24334865e51520e55190a646dd480cd7

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.3.0
Fixed
6.3.13
Type
ECOSYSTEM
Events
Introduced
6.4.0
Fixed
6.4.4

Database specific

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