Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tipc: fix RCU dereference race in tipc_aead_users_dec()

tipc_aead_users_dec() calls rcu_dereference(aead) twice: once to store
in 'tmp' for the NULL check, and again inside the atomic_add_unless()
call.

Use the already-dereferenced 'tmp' pointer consistently, matching the
correct pattern used in tipc_aead_users_inc() and tipc_aead_users_set().

Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Hodges <hodgesd@meta.com>
Link: https://patch.msgid.link/20260203145621.17399-1-git@danielhodges.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Hodges and committed by
Jakub Kicinski
6a65c0cb 48dec8d8

+1 -1
+1 -1
net/tipc/crypto.c
··· 460 460 rcu_read_lock(); 461 461 tmp = rcu_dereference(aead); 462 462 if (tmp) 463 - atomic_add_unless(&rcu_dereference(aead)->users, -1, lim); 463 + atomic_add_unless(&tmp->users, -1, lim); 464 464 rcu_read_unlock(); 465 465 } 466 466