Skip to content

Commit 71ad926

Browse files
PhilPottergregkh
authored andcommitted
net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb
[ Upstream commit d13f048 ] Modify the header size check in geneve6_xmit_skb and geneve_xmit_skb to use pskb_inet_may_pull rather than pskb_network_may_pull. This fixes two kernel selftest failures introduced by the commit introducing the checks: IPv4 over geneve6: PMTU exceptions IPv4 over geneve6: PMTU exceptions - nexthop objects It does this by correctly accounting for the fact that IPv4 packets may transit over geneve IPv6 tunnels (and vice versa), and still fixes the uninit-value bug fixed by the original commit. Reported-by: kernel test robot <oliver.sang@intel.com> Fixes: 6628ddf ("net: geneve: check skb is large enough for IPv4/IPv6 header") Suggested-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1fc6184 commit 71ad926

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/geneve.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
890890
__be16 sport;
891891
int err;
892892

893-
if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
893+
if (!pskb_inet_may_pull(skb))
894894
return -EINVAL;
895895

896896
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
@@ -987,7 +987,7 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
987987
__be16 sport;
988988
int err;
989989

990-
if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)))
990+
if (!pskb_inet_may_pull(skb))
991991
return -EINVAL;
992992

993993
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);

0 commit comments

Comments
 (0)