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 rxrpc_peer objects. The address list is freed under RCU and at this time, it puts the refs on those peers.
Now, when an rxrpc_peer 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->peer_hash_lock){+.?.}-{3:3}, at: rxrpc_put_peer+0xcb/0x180
{SOFTIRQ-ON-W} state was registered at:
mark_usage+0x164/0x180
__lock_acquire+0x544/0x990
lock_acquire.part.0+0x103/0x280
_raw_spin_lock+0x2f/0x40
rxrpc_peer_keepalive_worker+0x144/0x440
process_one_work+0x486/0x7c0
process_scheduled_works+0x73/0x90
worker_thread+0x1c8/0x2a0
kthread+0x19b/0x1b0
ret_from_fork+0x24/0x40
ret_from_fork_asm+0x1a/0x30
irq event stamp: 972402
hardirqs last enabled at (972402): [<ffffffff8244360e>] _raw_spin_unlock_irqrestore+0x2e/0x50
hardirqs last disabled at (972401): [<ffffffff82443328>] _raw_spin_lock_irqsave+0x18/0x60
softirqs last enabled at (972300): [<ffffffff810ffbbe>] handle_softirqs+0x3ee/0x430
softirqs last disabled at (972313): [<ffffffff810ffc54>] __irq_exit_rcu+0x44/0x110
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&rxnet->peer_hash_lock);
<Interrupt>
lock(&rxnet->peer_hash_lock);
*** DEADLOCK ***
1 lock held by swapper/1/0:
#0: ffffffff83576be0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire+0x7/0x30
stack backtrace:
CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Tainted: G E 6.13.0-rc5-build2+ #1223
Tainted: [E]=UNSIGNED_MODULE
Hardware name: ASUS All Series/H97-PLUS, BIOS 2306 10/09/2014
Call Trace:
<IRQ>
dump_stack_lvl+0x57/0x80
print_usage_bug.part.0+0x227/0x240
valid_state+0x53/0x70
mark_lock_irq+0xa5/0x2f0
mark_lock+0xf7/0x170
mark_usage+0xe1/0x180
__lock_acquire+0x544/0x990
lock_acquire.part.0+0x103/0x280
_raw_spin_lock+0x2f/0x40
rxrpc_put_peer+0xcb/0x180
afs_free_addrlist+0x46/0x90 [kafs]
rcu_do_batch+0x2d2/0x640
rcu_core+0x2f7/0x350
handle_softirqs+0x1ee/0x430
__irq_exit_rcu+0x44/0x110
irq_exit_rcu+0xa/0x30
sysvec_apic_timer_interrupt+0x7f/0xa0
</IRQ>
[
{
"target": {
"file": "net/rxrpc/peer_event.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"231062013245740791262834691452805040467",
"272746483038893300684413857598442782123",
"6018321098640154486663883090794123252",
"292043312720355555553933717714160948399",
"72006169085266693925388372089692327364",
"148686375889842541388210914426485410108",
"232979690554174734678249973767702601650",
"248149928994847797833248120187480594315",
"144643142886759184045860873189447200346",
"23500876858095854561544397055582759508",
"64493629509631246334266621238804096414",
"36422934915667171552862500301919846596",
"106921948937424550105350957114246169511",
"106864635102798453689144787161180114684",
"215993342901790013120624563428775667462",
"201930987043235115460519592262819717991",
"265930172922506773800869357961390567095",
"140857725604392413591179239493560214934",
"82755955986023066988839303540799805363",
"178726392264450661621832856354702286691",
"166326049057179029429916707237153910763",
"166211339912484178856993089705400584426",
"328510871078129754969036190268114028117",
"202582895062575742794790661989575336956",
"197790335240439861031342143685584269182",
"187944226995425708787118436375568643805",
"290531473161559337931945496368033682409",
"52658006626609984074630471898353308781",
"271817672719948162245771715394576909111"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@79d458c13056559d49b5e41fbc4b6890e68cf65b",
"deprecated": false,
"id": "CVE-2025-21809-615173bb",
"signature_type": "Line"
},
{
"target": {
"file": "net/rxrpc/peer_object.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"235197755545624870522244333749546306312",
"227249725459403789978848267753961509291",
"38223526291266893903373515870299802899",
"258669335401253647837643817628803244476",
"294019349045420835755137428457989395493",
"247737086992160027668631155174909032882",
"216816337920046050393121563647753404611",
"128011663853926907737191603783626360268",
"285122975587057047766370967890515819286",
"74010783947271936653425484737596385463",
"146534301885258279078628757401113210730",
"293979074809316007756733419820389717532",
"284352922250114594681323164039940770382",
"178838842786635971036243014741875434042",
"189903961830872578167703034148334855138",
"278179297660689453412542353277967813219",
"119789904528051232919746547959063331965",
"265172781011339454872693347335068498354",
"40639725426250295405798563632520481272",
"83125562639854585134694971227121790670",
"69669048322269709953212899158998794670",
"10290613452758005600055075971268330337"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@10ba5a3d57af20e494e0d979d1894260989235dd",
"deprecated": false,
"id": "CVE-2025-21809-c4133ab3",
"signature_type": "Line"
},
{
"target": {
"file": "net/rxrpc/peer_object.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"235197755545624870522244333749546306312",
"227249725459403789978848267753961509291",
"38223526291266893903373515870299802899",
"258669335401253647837643817628803244476",
"294019349045420835755137428457989395493",
"247737086992160027668631155174909032882",
"216816337920046050393121563647753404611",
"128011663853926907737191603783626360268",
"285122975587057047766370967890515819286",
"74010783947271936653425484737596385463",
"146534301885258279078628757401113210730",
"293979074809316007756733419820389717532",
"284352922250114594681323164039940770382",
"178838842786635971036243014741875434042",
"189903961830872578167703034148334855138",
"278179297660689453412542353277967813219",
"119789904528051232919746547959063331965",
"265172781011339454872693347335068498354",
"40639725426250295405798563632520481272",
"83125562639854585134694971227121790670",
"69669048322269709953212899158998794670",
"10290613452758005600055075971268330337"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@79d458c13056559d49b5e41fbc4b6890e68cf65b",
"deprecated": false,
"id": "CVE-2025-21809-d32d2dff",
"signature_type": "Line"
},
{
"target": {
"file": "net/rxrpc/peer_event.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"231062013245740791262834691452805040467",
"272746483038893300684413857598442782123",
"6018321098640154486663883090794123252",
"292043312720355555553933717714160948399",
"72006169085266693925388372089692327364",
"148686375889842541388210914426485410108",
"232979690554174734678249973767702601650",
"248149928994847797833248120187480594315",
"144643142886759184045860873189447200346",
"23500876858095854561544397055582759508",
"64493629509631246334266621238804096414",
"36422934915667171552862500301919846596",
"106921948937424550105350957114246169511",
"106864635102798453689144787161180114684",
"215993342901790013120624563428775667462",
"201930987043235115460519592262819717991",
"265930172922506773800869357961390567095",
"140857725604392413591179239493560214934",
"82755955986023066988839303540799805363",
"178726392264450661621832856354702286691",
"166326049057179029429916707237153910763",
"166211339912484178856993089705400584426",
"328510871078129754969036190268114028117",
"202582895062575742794790661989575336956",
"197790335240439861031342143685584269182",
"187944226995425708787118436375568643805",
"290531473161559337931945496368033682409",
"52658006626609984074630471898353308781",
"271817672719948162245771715394576909111"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@10ba5a3d57af20e494e0d979d1894260989235dd",
"deprecated": false,
"id": "CVE-2025-21809-da401bdb",
"signature_type": "Line"
}
]