diff options
author | Ingo Molnar <mingo@kernel.org> | 2023-12-23 15:52:13 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-12-23 15:52:13 +0100 |
commit | d2e9f53ac5dd76dadc0b5f04f6c27640604ce2af (patch) | |
tree | bf82d9fbfdc2ce67630fdacc18c2231f3d17876a /net/ipv4/ip_gre.c | |
parent | 418146e39891ef1fb2284dee4cabbfe616cd21cf (diff) | |
parent | ceb6a6f023fd3e8b07761ed900352ef574010bcb (diff) |
Merge tag 'v6.7-rc6' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r-- | net/ipv4/ip_gre.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 22a26d1d29a0..5169c3c72cff 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -635,15 +635,18 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, } if (dev->header_ops) { + int pull_len = tunnel->hlen + sizeof(struct iphdr); + if (skb_cow_head(skb, 0)) goto free_skb; tnl_params = (const struct iphdr *)skb->data; - /* Pull skb since ip_tunnel_xmit() needs skb->data pointing - * to gre header. - */ - skb_pull(skb, tunnel->hlen + sizeof(struct iphdr)); + if (!pskb_network_may_pull(skb, pull_len)) + goto free_skb; + + /* ip_tunnel_xmit() needs skb->data pointing to gre header. */ + skb_pull(skb, pull_len); skb_reset_mac_header(skb); if (skb->ip_summed == CHECKSUM_PARTIAL && |