Skip to content
Commit 80e679b3 authored by Hyunwoo Kim's avatar Hyunwoo Kim Committed by Jakub Kicinski
Browse files

tcp: Fix Use-After-Free in tcp_ao_connect_init

Since call_rcu, which is called in the hlist_for_each_entry_rcu traversal
of tcp_ao_connect_init, is not part of the RCU read critical section, it
is possible that the RCU grace period will pass during the traversal and
the key will be free.

To prevent this, it should be changed to hlist_for_each_entry_safe.

Fixes: 7c2ffaf2

 ("net/tcp: Calculate TCP-AO traffic keys")
Signed-off-by: default avatarHyunwoo Kim <v4bel@theori.io>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Link: https://lore.kernel.org/r/ZiYu9NJ/ClR8uSkH@v4bel-B760M-AORUS-ELITE-AX
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4ce62d5b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment