diff options
author | David S. Miller <davem@davemloft.net> | 2019-06-11 12:07:33 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-11 12:08:05 -0700 |
commit | 93c65f83f25bd5e072a42c9659a85fdc4fb47c27 (patch) | |
tree | 994badb500db658d9b407df09903fe180bae25a2 | |
parent | 309b66970ee2abf721ecd0876a48940fa0b99a35 (diff) | |
parent | eccc73a6b2cb6c04bfbc40a0769f3c428dfba232 (diff) | |
download | linux-93c65f83f25bd5e072a42c9659a85fdc4fb47c27.tar.bz2 |
Merge branch 'vxlan-geneve-linear'
Stefano Brivio says:
====================
Don't assume linear buffers in error handlers for VXLAN and GENEVE
Guillaume noticed the same issue fixed by commit 26fc181e6cac ("fou, fou6:
do not assume linear skbs") for fou and fou6 is also present in VXLAN and
GENEVE error handlers: we can't assume linear buffers there, we need to
use pskb_may_pull() instead.
====================
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/geneve.c | 2 | ||||
-rw-r--r-- | drivers/net/vxlan.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 98d1a45c0606..25770122c219 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -395,7 +395,7 @@ static int geneve_udp_encap_err_lookup(struct sock *sk, struct sk_buff *skb) u8 zero_vni[3] = { 0 }; u8 *vni = zero_vni; - if (skb->len < GENEVE_BASE_HLEN) + if (!pskb_may_pull(skb, skb_transport_offset(skb) + GENEVE_BASE_HLEN)) return -EINVAL; geneveh = geneve_hdr(skb); diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 5994d5415a03..4c9bc29fe3d5 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1766,7 +1766,7 @@ static int vxlan_err_lookup(struct sock *sk, struct sk_buff *skb) struct vxlanhdr *hdr; __be32 vni; - if (skb->len < VXLAN_HLEN) + if (!pskb_may_pull(skb, skb_transport_offset(skb) + VXLAN_HLEN)) return -EINVAL; hdr = vxlan_hdr(skb); |