Skip to content

net: Fix UAF of sk_dst_get(sk)->dev.

Kuniyuki Iwashima netdev 2 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 17 repliesApplied 7/7
  2. v18 patches 14 repliesSuperseded

Changes in v2 from the cover letter

* Rebase to net-next (Eric)
* Drop tcp patch as it's already fixed in net-next (Eric)
* Drop sk_dst_dev_rcu() helper patch and use dst_dev_rcu() directly (Eric)
* Split mptcp dst_release() patch (Matthieu)

Patches in v2 All 7 applied

#Subject and filesSizeRepliesApplied
1/7smc: Fix use-after-free in __pnet_find_base_ndev().net/smc/smc_pnet.c+22 -213 repliesApplied
2/7smc: Use __sk_dst_get() and dst_dev_rcu() in in smc_clc_prfx_set().net/smc/smc_clc.c+22 -191 replyApplied
3/7smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().net/smc/smc_clc.c+13 -131 replyApplied
4/7smc: Use __sk_dst_get() and dst_dev_rcu() in smc_vlan_by_tcpsk().net/smc/smc_core.c+12 -154 repliesApplied
5/7tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().net/tls/tls_device.c+10 -82 repliesApplied
6/7mptcp: Call dst_release() in mptcp_active_enable().net/mptcp/ctrl.c+2 -03 repliesApplied
7/7mptcp: Use __sk_dst_get() and dst_dev_rcu() in mptcp_active_enable().net/mptcp/ctrl.c+7 -43 repliesApplied

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMatthieu Baerts (NGI0)Eric DumazetSabrina Dubroca
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b R-b
6/7R-b R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/7] net: Fix UAF of sk_dst_get(sk)->dev.

syzbot caught use-after-free of sk_dst_get(sk)->dev, which was not fetched under RCU nor RTNL. [0]

Patch 1 ~ 5, 7 fix UAF in smc, tcp, ktls, mptcp
Patch 6 fixes dst ref leak in mptcp

[0]: https://lore.kernel.org/netdev/[email protected]/

Changes:
v2:
* Rebase to net-next (Eric)
* Drop tcp patch as it's already fixed in net-next (Eric)
* Drop sk_dst_dev_rcu() helper patch and use dst_dev_rcu() directly (Eric)
* Split mptcp dst_release() patch (Matthieu)

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (7):
smc: Fix use-after-free in __pnet_find_base_ndev().
smc: Use __sk_dst_get() and dst_dev_rcu() in in smc_clc_prfx_set().
smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().
smc: Use __sk_dst_get() and dst_dev_rcu() in smc_vlan_by_tcpsk().
tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().
mptcp: Call dst_release() in mptcp_active_enable().
mptcp: Use __sk_dst_get() and dst_dev_rcu() in mptcp_active_enable().

 net/mptcp/ctrl.c     |  9 ++++--
 net/smc/smc_clc.c    | 67 +++++++++++++++++++++++---------------------
 net/smc/smc_core.c   | 27 ++++++++----------
 net/smc/smc_pnet.c   | 43 ++++++++++++++--------------
 net/tls/tls_device.c | 18 ++++++------
 5 files changed, 86 insertions(+), 78 deletions(-)
Signature · 1 line
2.51.0.384.g4c02a37b29-goog