netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 0/5] tcp/rds: Fix use-after-free around kernel TCP reqsk.
@ 2024-02-27  1:10 Kuniyuki Iwashima
  2024-02-27  1:10 ` [PATCH v2 net 1/5] tcp: Restart iteration after removing reqsk in inet_twsk_purge() Kuniyuki Iwashima
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Kuniyuki Iwashima @ 2024-02-27  1:10 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Allison Henderson
  Cc: Kuniyuki Iwashima, Kuniyuki Iwashima, netdev, linux-rdma,
	rds-devel

syzkaller reported an warning of netns ref tracker for RDS TCP listener,
which commit 740ea3c4a0b2 ("tcp: Clean up kernel listener's reqsk in
inet_twsk_purge()") partially fixed.

This series fixes the bug in the partial fix, reverts the partial fix,
and fixes the root cause on the RDS side.


Changes:
  v2:
    * Add patch 1, 3, 5
    * Use __sock_create() instead of converting socket
    * Drop Sowmini from CC as it's bounced (patchwork may complain)

  v1: https://lore.kernel.org/netdev/20240223172448.94084-1-kuniyu@amazon.com/


Kuniyuki Iwashima (5):
  tcp: Restart iteration after removing reqsk in inet_twsk_purge().
  Revert "tcp: Clean up kernel listener's reqsk in inet_twsk_purge()"
  net: Convert @kern of __sock_create() to enum.
  rds: tcp: Fix use-after-free of net in reqsk_timer_handler().
  tcp: Add assertion for reqsk->rsk_listener->sk_net_refcnt.

 include/linux/net.h           |  6 ++++++
 net/core/sock.c               |  2 +-
 net/ipv4/inet_timewait_sock.c | 14 +-------------
 net/ipv4/tcp_input.c          |  2 ++
 net/ipv4/tcp_minisocks.c      |  9 ++++-----
 net/rds/tcp_listen.c          |  4 ++--
 net/socket.c                  | 11 ++++++-----
 7 files changed, 22 insertions(+), 26 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-29 21:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27  1:10 [PATCH v2 net 0/5] tcp/rds: Fix use-after-free around kernel TCP reqsk Kuniyuki Iwashima
2024-02-27  1:10 ` [PATCH v2 net 1/5] tcp: Restart iteration after removing reqsk in inet_twsk_purge() Kuniyuki Iwashima
2024-02-27  1:10 ` [PATCH v2 net 2/5] Revert "tcp: Clean up kernel listener's reqsk in inet_twsk_purge()" Kuniyuki Iwashima
2024-02-27  1:10 ` [PATCH v2 net 3/5] net: Convert @kern of __sock_create() to enum Kuniyuki Iwashima
2024-02-29 21:51   ` David Laight
2024-02-27  1:10 ` [PATCH v2 net 4/5] rds: tcp: Fix use-after-free of net in reqsk_timer_handler() Kuniyuki Iwashima
2024-02-27 12:06   ` Eric Dumazet
2024-02-28  2:24     ` Kuniyuki Iwashima
2024-02-27  1:10 ` [PATCH v2 net 5/5] tcp: Add assertion for reqsk->rsk_listener->sk_net_refcnt Kuniyuki Iwashima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).