CVE-2025-21986: net: switchdev: Convert blocking notification chain to a raw one

Published Apr 1, 2025
·
Updated

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

net: switchdev: Convert blocking notification chain to a raw one

A blocking notification chain uses a read-write semaphore to protect the integrity of the chain. The semaphore is acquired for writing when adding / removing notifiers to / from the chain and acquired for reading when traversing the chain and informing notifiers about an event.

In case of the blocking switchdev notification chain, recursive notifications are possible which leads to the semaphore being acquired twice for reading and to lockdep warnings being generated [1].

Specifically, this can happen when the bridge driver processes a SWITCHDEVBRPORTUNOFFLOADED event which causes it to emit notifications about deferred events when calling switchdevdeferredprocess().

Fix this by converting the notification chain to a raw notification chain in a similar fashion to the netdev notification chain. Protect the chain using the RTNL mutex by acquiring it when modifying the chain. Events are always informed under the RTNL mutex, but add an assertion in callswitchdevblockingnotifiers() to make sure this is not violated in the future.

Maintain the "blocking" prefix as events are always emitted from process context and listeners are allowed to block.

[1]: WARNING: possible recursive locking detected 6.14.0-rc4-custom-g079270089484 #1 Not tainted -------------------------------------------- ip/52731 is trying to acquire lock: ffffffff850918d8 ((switchdevblockingnotifchain).rwsem){++++}-{4:4}, at: blockingnotifiercallchain+0x58/0xa0

but task is already holding lock: ffffffff850918d8 ((switchdevblockingnotifchain).rwsem){++++}-{4:4}, at: blockingnotifiercallchain+0x58/0xa0

other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock((switchdevblockingnotifchain).rwsem); lock((switchdevblockingnotifchain).rwsem);

DEADLOCK May be due to missing lock nesting notation 3 locks held by ip/52731: #0: ffffffff84f795b0 (rtnlmutex){+.+.}-{4:4}, at: rtnlnewlink+0x727/0x1dc0 #1: ffffffff8731f628 (&net->rtnlmutex){+.+.}-{4:4}, at: rtnlnewlink+0x790/0x1dc0 #2: ffffffff850918d8 ((switchdevblockingnotifchain).rwsem){++++}-{4:4}, at: blockingnotifiercallchain+0x58/0xa0

stack backtrace: ... ? pfxdownread+0x10/0x10 ? pfxmarklock+0x10/0x10 ? pfxswitchdevportattrsetdeferred+0x10/0x10 blockingnotifiercallchain+0x58/0xa0 switchdevportattrnotify.constprop.0+0xb3/0x1b0 ? pfxswitchdevportattrnotify.constprop.0+0x10/0x10 ? markheldlocks+0x94/0xe0 ? switchdevdeferredprocess+0x11a/0x340 switchdevportattrsetdeferred+0x27/0xd0 switchdevdeferredprocess+0x164/0x340 brswitchdevportunoffload+0xc8/0x100 [bridge] brswitchdevblockingevent+0x29f/0x580 [bridge] notifiercallchain+0xa2/0x440 blockingnotifiercallchain+0x6e/0xa0 switchdevbridgeportunoffload+0xde/0x1a0 ...

Affected Software

16 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.1.80<6.1.132
Linux Linux kernel>=6.6.19<6.6.84
Linux Linux kernel>=6.7.7<6.8
Linux Linux kernel>=6.8.1<6.12.20
Linux Linux kernel>=6.13<6.13.8
Linux Linux kernel=6.8
Linux Linux kernel=6.8-rc6
Linux Linux kernel=6.8-rc7
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Linux Linux kernel=6.14-rc5
Linux Linux kernel=6.14-rc6
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Event History

Apr 1, 2025
CVE Published
via MITRE·03:47 PM
Data Sourced
via MITRE·03:47 PM
Description
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-21986?

CVE-2025-21986 has been classified as a medium severity vulnerability.

2

How do I fix CVE-2025-21986?

To fix CVE-2025-21986, update your Linux kernel to the latest patched version provided by your distribution.

3

What software is affected by CVE-2025-21986?

The vulnerability CVE-2025-21986 affects the Linux kernel.

4

What type of vulnerability is CVE-2025-21986?

CVE-2025-21986 is a vulnerability related to blocking notification chains in the Linux networking stack.

5

Has CVE-2025-21986 been resolved?

Yes, CVE-2025-21986 has been resolved in subsequent updates of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203