diff options
| author | Ingo Molnar <[email protected]> | 2018-05-14 11:22:59 +0200 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-05-14 11:22:59 +0200 |
| commit | 4b96583869c4d990b779eca72976063970d41b8d (patch) | |
| tree | f2fdb7760a06f6445f33fdee3ec512fbdb46fcb4 /net/nsh/nsh.c | |
| parent | 53667c670fe00d63246fb3cfb4480bb1ba247bcc (diff) | |
| parent | 67b8d5c7081221efa252e111cd52532ec6d4266f (diff) | |
Merge tag 'v4.17-rc5' into irq/core, to pick up fixes
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/nsh/nsh.c')
| -rw-r--r-- | net/nsh/nsh.c | 4 |
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; |