]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tipc: fix RCU dereference race in tipc_aead_users_dec()
authorDaniel Hodges <hodgesd@meta.com>
Tue, 3 Feb 2026 14:56:21 +0000 (09:56 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:23 +0000 (07:21 -0500)
commitd58f8d4dcfb1c81c15afc3b8bbfd34846ae84982
tree9e121f0bdfe0e6e425257648be449fe9ce44eb29
parentead66f2ed16f3e61aea352f0094433ee05cf3e2d
tipc: fix RCU dereference race in tipc_aead_users_dec()

[ Upstream commit 6a65c0cb0ff20b3cbc5f1c87b37dd22cdde14a1c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/crypto.c