]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: Free TCP-AO/TCP-MD5 info/keys without RCU
authorDmitry Safonov <dima@arista.com>
Tue, 9 Sep 2025 01:18:51 +0000 (02:18 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Sep 2025 02:05:56 +0000 (19:05 -0700)
commit51e547e8c89c661f6fbede4a28b1d33b13625683
tree969fce1577d9063dd7d33d657677702afa7ff41f
parent9e472d9e84b11e9f3c429eba97c2a9e74461a884
tcp: Free TCP-AO/TCP-MD5 info/keys without RCU

Now that the destruction of info/keys is delayed until the socket
destructor, it's safe to use kfree() without an RCU callback.
The socket is in TCP_CLOSE state either because it never left it,
or it's already closed and the refcounter is zero. In any way,
no one can discover it anymore, it's safe to release memory
straight away.

Similar thing was possible for twsk already.

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://patch.msgid.link/20250909-b4-tcp-ao-md5-rst-finwait2-v5-2-9ffaaaf8b236@arista.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp_ao.h
net/ipv4/tcp.c
net/ipv4/tcp_ao.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c