All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Allison Henderson <allison.henderson@oracle.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, <rds-devel@oss.oracle.com>
Subject: [PATCH v5 net 0/2] tcp/rds: Fix use-after-free around kernel TCP reqsk.
Date: Fri, 8 Mar 2024 12:01:20 -0800	[thread overview]
Message-ID: <20240308200122.64357-1-kuniyu@amazon.com> (raw)

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()") fixed for per-netns ehash.

This series fixes the bug in the partial fix and fixes the reported bug
in the global ehash.


Changes:
  v5:
    * Reuse the correct logic for reqsk in inet_twsk_purge().

  v4: https://lore.kernel.org/netdev/20240307232151.55963-1-kuniyu@amazon.com/
    * Add sk_family/refcnt check in inet_twsk_purge().

  v3: https://lore.kernel.org/netdev/20240307224423.53315-1-kuniyu@amazon.com/
    * Drop patch 2, 3, 5
    * Fix uaf by iterating ehash and purging reqsk during netns dismantle.

  v2: https://lore.kernel.org/netdev/20240227011041.97375-1-kuniyu@amazon.com/
    * 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/


Eric Dumazet (1):
  tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge()

Kuniyuki Iwashima (1):
  rds: tcp: Fix use-after-free of net in reqsk_timer_handler().

 net/ipv4/inet_timewait_sock.c | 41 ++++++++++++++++-------------------
 net/ipv4/tcp_minisocks.c      |  4 ----
 2 files changed, 19 insertions(+), 26 deletions(-)

-- 
2.30.2


             reply	other threads:[~2024-03-08 20:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 20:01 Kuniyuki Iwashima [this message]
2024-03-08 20:01 ` [PATCH v5 net 1/2] tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge() Kuniyuki Iwashima
2024-03-08 20:01 ` [PATCH v5 net 2/2] rds: tcp: Fix use-after-free of net in reqsk_timer_handler() Kuniyuki Iwashima
2024-03-12 11:04   ` Paolo Abeni
2024-03-12 12:34     ` Eric Dumazet
2024-03-12 15:10 ` [PATCH v5 net 0/2] tcp/rds: Fix use-after-free around kernel TCP reqsk patchwork-bot+netdevbpf
2024-03-12 15:59   ` Jakub Kicinski
2024-03-13  2:02     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308200122.64357-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=allison.henderson@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rds-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.