Skip to content

tcp/rds: Fix use-after-free around kernel TCP reqsk.

Kuniyuki Iwashima linux-rdma netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 4 repliesApplied 2/2
  2. v42 patches 1 replySuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v25 patches3 repliesSuperseded

Changes in v5 from the cover letter

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

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge()net/ipv4/inet_timewait_sock.c+19 -220 repliesApplied
2/2rds: tcp: Fix use-after-free of net in reqsk_timer_handler().net/ipv4/tcp_minisocks.c+0 -42 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchEric Dumazet
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 net 0/2] tcp/rds: Fix use-after-free around kernel TCP reqsk.

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/[email protected]/
* Add sk_family/refcnt check in inet_twsk_purge().

v3: https://lore.kernel.org/netdev/[email protected]/
* Drop patch 2, 3, 5
* Fix uaf by iterating ehash and purging reqsk during netns dismantle.

v2: https://lore.kernel.org/netdev/[email protected]/
* 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/[email protected]/

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(-)
Signature · 1 line
2.30.2