diff options
| author | Thomas Gleixner <[email protected]> | 2018-05-19 15:20:49 +0200 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2018-05-19 15:20:49 +0200 |
| commit | 95b5c0a592c712496dce6c1ed772d5f9026b5ed3 (patch) | |
| tree | ef00485760be3388bafc2eed41da185fb8a4858a /net/nsh/nsh.c | |
| parent | 985c78d3ff8e9c74450fa2bb08eb55e680d999ca (diff) | |
| parent | 78ce241099bb363b19dbd0245442e66c8de8f567 (diff) | |
Merge branch 'ras/urgent' into ras/core
Pick up urgent fix as pending patch depends on it.
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; |