summaryrefslogtreecommitdiff
path: root/net/nsh/nsh.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-05-18 14:08:53 +1000
committerDave Airlie <airlied@redhat.com>2018-05-18 14:08:53 +1000
commit1fafef9dfe127bdd4600eeaca302f0c1cb4ee5d0 (patch)
treef829e8a26fc768666eb5f827bf5817892ea7e46c /net/nsh/nsh.c
parent315852b422972e6ebb1dfddaadada09e46a2681a (diff)
parent76ef6b28ea4f81c3d511866a9b31392caa833126 (diff)
downloadlinux-next-1fafef9dfe127bdd4600eeaca302f0c1cb4ee5d0.tar.gz
Merge drm-fixes-for-v4.17-rc6-urgent into drm-next
Need to backmerge some nouveau fixes to reduce the nouveau -next conflicts a lot. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'net/nsh/nsh.c')
-rw-r--r--net/nsh/nsh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index d7da99a0b0b8..9696ef96b719 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -57,6 +57,8 @@ int nsh_pop(struct sk_buff *skb)
return -ENOMEM;
nh = (struct nshhdr *)(skb->data);
length = nsh_hdr_len(nh);
+ if (length < NSH_BASE_HDR_LEN)
+ return -EINVAL;
inner_proto = tun_p_to_eth_p(nh->np);
if (!pskb_may_pull(skb, length))
return -ENOMEM;
@@ -90,6 +92,8 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN)))
goto out;
nsh_len = nsh_hdr_len(nsh_hdr(skb));
+ if (nsh_len < NSH_BASE_HDR_LEN)
+ goto out;
if (unlikely(!pskb_may_pull(skb, nsh_len)))
goto out;