CVE-2025-21809: rxrpc, afs: Fix peer hash locking vs RCU callback

Published Feb 27, 2025
·
Updated

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

rxrpc, afs: Fix peer hash locking vs RCU callback

In its address list, afs now retains pointers to and refs on one or more rxrpcpeer objects. The address list is freed under RCU and at this time, it puts the refs on those peers.

Now, when an rxrpcpeer object runs out of refs, it gets removed from the peer hash table and, for that, rxrpc has to take a spinlock. However, it is now being called from afs's RCU cleanup, which takes place in BH context - but it is just taking an ordinary spinlock.

The put may also be called from non-BH context, and so there exists the possibility of deadlock if the BH-based RCU cleanup happens whilst the hash spinlock is held. This led to the attached lockdep complaint.

Fix this by changing spinlocks of rxnet->peerhashlock back to BH-disabling locks.

================================ WARNING: inconsistent lock state 6.13.0-rc5-build2+ #1223 Tainted: G E -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. swapper/1/0 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff88810babe228 (&rxnet->peerhashlock){+.?.}-{3:3}, at: rxrpcputpeer+0xcb/0x180 {SOFTIRQ-ON-W} state was registered at: markusage+0x164/0x180 lockacquire+0x544/0x990 lockacquire.part.0+0x103/0x280 rawspinlock+0x2f/0x40 rxrpcpeerkeepaliveworker+0x144/0x440 processonework+0x486/0x7c0 processscheduledworks+0x73/0x90 workerthread+0x1c8/0x2a0 kthread+0x19b/0x1b0 retfromfork+0x24/0x40 retfromforkasm+0x1a/0x30 irq event stamp: 972402 hardirqs last enabled at (972402): [<ffffffff8244360e>] rawspinunlockirqrestore+0x2e/0x50 hardirqs last disabled at (972401): [<ffffffff82443328>] rawspinlockirqsave+0x18/0x60 softirqs last enabled at (972300): [<ffffffff810ffbbe>] handlesoftirqs+0x3ee/0x430 softirqs last disabled at (972313): [<ffffffff810ffc54>] irqexitrcu+0x44/0x110

other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&rxnet->peerhashlock); <Interrupt> lock(&rxnet->peerhashlock);

DEADLOCK 1 lock held by swapper/1/0: #0: ffffffff83576be0 (rcucallback){....}-{0:0}, at: rculockacquire+0x7/0x30

stack backtrace: CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G E 6.13.0-rc5-build2+ #1223 Tainted: [E]=UNSIGNEDMODULE Hardware name: ASUS All Series/H97-PLUS, BIOS 2306 10/09/2014 Call Trace: <IRQ> dumpstacklvl+0x57/0x80 printusagebug.part.0+0x227/0x240 validstate+0x53/0x70 marklockirq+0xa5/0x2f0 marklock+0xf7/0x170 markusage+0xe1/0x180 lockacquire+0x544/0x990 lockacquire.part.0+0x103/0x280 rawspinlock+0x2f/0x40 rxrpcputpeer+0xcb/0x180 afsfreeaddrlist+0x46/0x90 [kafs] rcudobatch+0x2d2/0x640 rcucore+0x2f7/0x350 handlesoftirqs+0x1ee/0x430 irqexitrcu+0x44/0x110 irqexitrcu+0xa/0x30 sysvecapictimerinterrupt+0x7f/0xa0 </IRQ>

Affected Software

3 affected components
Linux Linux kernel>=6.7.3<6.12.13
Linux Linux kernel>=6.13<6.13.2
Linux Kernel>6.13.0-rc5

Event History

Feb 27, 2025
CVE Published
via MITRE·08:01 PM
Data Sourced
via MITRE·08:01 PM
DescriptionSeverity
Data Sourced
via NVD·08:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-21809?

CVE-2025-21809 has been categorized with a moderate severity level due to its potential impact on the Linux kernel.

2

How do I fix CVE-2025-21809?

To resolve CVE-2025-21809, upgrade the Linux kernel to the latest version where the vulnerability has been patched.

3

Which versions of the Linux kernel are affected by CVE-2025-21809?

CVE-2025-21809 affects versions of the Linux kernel starting from 6.13.0-rc5 and earlier.

4

What type of vulnerability is CVE-2025-21809?

CVE-2025-21809 is a locking issue related to the rxrpc and afs subsystems in the Linux kernel.

5

Is there a workaround for CVE-2025-21809 if I cannot upgrade the kernel?

No official workaround has been provided for CVE-2025-21809, so upgrading is strongly recommended.

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