Skip to content

Commit e2be74a

Browse files
hkallweitgregkh
authored andcommitted
net: warn if gso_type isn't set for a GSO SKB
[ Upstream commit 1d155df ] In bug report [0] a warning in r8169 driver was reported that was caused by an invalid GSO SKB (gso_type was 0). See [1] for a discussion about this issue. Still the origin of the invalid GSO SKB isn't clear. It shouldn't be a network drivers task to check for invalid GSO SKB's. Also, even if issue [0] can be fixed, we can't be sure that a similar issue doesn't pop up again at another place. Therefore let gso_features_check() check for such invalid GSO SKB's. [0] https://bugzilla.kernel.org/show_bug.cgi?id=209423 [1] https://www.spinics.net/lists/netdev/msg690794.html Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/97c78d21-7f0b-d843-df17-3589f224d2cf@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 24ab059 ("net: check dev->gso_max_size in gso_features_check()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ecc8805 commit e2be74a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/core/dev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,6 +3200,11 @@ static netdev_features_t gso_features_check(const struct sk_buff *skb,
32003200
if (gso_segs > dev->gso_max_segs)
32013201
return features & ~NETIF_F_GSO_MASK;
32023202

3203+
if (!skb_shinfo(skb)->gso_type) {
3204+
skb_warn_bad_offload(skb);
3205+
return features & ~NETIF_F_GSO_MASK;
3206+
}
3207+
32033208
/* Support for GSO partial features requires software
32043209
* intervention before we can actually process the packets
32053210
* so we need to strip support for any partial features now

0 commit comments

Comments
 (0)