diff options
author | Eric Dumazet <edumazet@google.com> | 2022-04-30 04:15:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-30 15:25:29 +0300 |
commit | 783d108dd71d97e4cac5fe8ce70ca43ed7dc7bb7 (patch) | |
tree | d5ccf3197675cf26ff4e9250544b4a3a84ed4b88 /drivers/net/ethernet/mscc | |
parent | 90e29e592ec95c5c2af6fe73896dba40303728cf (diff) | |
download | linux-783d108dd71d97e4cac5fe8ce70ca43ed7dc7bb7.tar.xz |
tcp: drop skb dst in tcp_rcv_established()
In commit f84af32cbca7 ("net: ip_queue_rcv_skb() helper")
I dropped the skb dst in tcp_data_queue().
This only dealt with so-called TCP input slow path.
When fast path is taken, tcp_rcv_established() calls
tcp_queue_rcv() while skb still has a dst.
This was mostly fine, because most dsts at this point
are not refcounted (thanks to early demux)
However, TCP packets sent over loopback have refcounted dst.
Then commit 68822bdf76f1 ("net: generalize skb freeing
deferral to per-cpu lists") came and had the effect
of delaying skb freeing for an arbitrary time.
If during this time the involved netns is dismantled, cleanup_net()
frees the struct net with embedded net->ipv6.ip6_dst_ops.
Then when eventually dst_destroy_rcu() is called,
if (dst->ops->destroy) ... triggers an use-after-free.
It is not clear if ip6_route_net_exit() lacks a rcu_barrier()
as syzbot reported similar issues before the blamed commit.
( https://groups.google.com/g/syzkaller-bugs/c/CofzW4eeA9A/m/009WjumTAAAJ )
Fixes: 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc')
0 files changed, 0 insertions, 0 deletions