projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a07ae6
)
ip6_gre: fix a pontential issue in ip6erspan_rcv
author
Haishuang Yan
<
[email protected]
>
Wed, 20 Dec 2017 01:53:19 +0000
(09:53 +0800)
committer
David S. Miller
<
[email protected]
>
Wed, 20 Dec 2017 18:48:39 +0000
(13:48 -0500)
pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at
the right place.
Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Cc: William Tu <
[email protected]
>
Acked-by: William Tu <
[email protected]
>
Signed-off-by: Haishuang Yan <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv6/ip6_gre.c
patch
|
blob
|
history
diff --git
a/net/ipv6/ip6_gre.c
b/net/ipv6/ip6_gre.c
index 87b9892dfa235ecc7cfcdeade3505781d826fb5f..9bd110371fe374f92b35199053bb62db7ebbc1aa 100644
(file)
--- a/
net/ipv6/ip6_gre.c
+++ b/
net/ipv6/ip6_gre.c
@@
-507,12
+507,11
@@
static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len,
struct ip6_tnl *tunnel;
u8 ver;
- ipv6h = ipv6_hdr(skb);
- ershdr = (struct erspan_base_hdr *)skb->data;
-
if (unlikely(!pskb_may_pull(skb, sizeof(*ershdr))))
return PACKET_REJECT;
+ ipv6h = ipv6_hdr(skb);
+ ershdr = (struct erspan_base_hdr *)skb->data;
ver = (ntohs(ershdr->ver_vlan) & VER_MASK) >> VER_OFFSET;
tpi->key = cpu_to_be32(ntohs(ershdr->session_id) & ID_MASK);