diff options
author | Eric Dumazet <edumazet@google.com> | 2021-01-19 08:49:00 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-19 17:57:59 -0800 |
commit | b160c28548bc0a87cbd16d5af6d3edcfd70b8c9a (patch) | |
tree | 0e0da53f6dc8add3a37b6db8b35b2180e82cb416 /mm/swap_cgroup.c | |
parent | fd23d2dc180fccfad4b27a8e52ba1bc415d18509 (diff) | |
download | linux-b160c28548bc0a87cbd16d5af6d3edcfd70b8c9a.tar.bz2 |
tcp: do not mess with cloned skbs in tcp_add_backlog()
Heiner Kallweit reported that some skbs were sent with
the following invalid GSO properties :
- gso_size > 0
- gso_type == 0
This was triggerring a WARN_ON_ONCE() in rtl8169_tso_csum_v2.
Juerg Haefliger was able to reproduce a similar issue using
a lan78xx NIC and a workload mixing TCP incoming traffic
and forwarded packets.
The problem is that tcp_add_backlog() is writing
over gso_segs and gso_size even if the incoming packet will not
be coalesced to the backlog tail packet.
While skb_try_coalesce() would bail out if tail packet is cloned,
this overwriting would lead to corruptions of other packets
cooked by lan78xx, sharing a common super-packet.
The strategy used by lan78xx is to use a big skb, and split
it into all received packets using skb_clone() to avoid copies.
The drawback of this strategy is that all the small skb share a common
struct skb_shared_info.
This patch rewrites TCP gso_size/gso_segs handling to only
happen on the tail skb, since skb_try_coalesce() made sure
it was not cloned.
Fixes: 4f693b55c3d2 ("tcp: implement coalescing on backlog queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Bisected-by: Juerg Haefliger <juergh@canonical.com>
Tested-by: Juerg Haefliger <juergh@canonical.com>
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=209423
Link: https://lore.kernel.org/r/20210119164900.766957-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'mm/swap_cgroup.c')
0 files changed, 0 insertions, 0 deletions