summaryrefslogtreecommitdiffstats
path: root/drivers/net/gtp.c
diff options
context:
space:
mode:
authorPablo Neira <pablo@netfilter.org>2016-05-10 21:33:38 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-10 15:56:23 -0400
commit93edb8c7f94fb3d384790ac8a83c3fb9389f6ca5 (patch)
tree76baacecad6ebd442b864df240b9ed5224107e41 /drivers/net/gtp.c
parent1dee3f59a8d5e711797dc82628aaf94a64e99922 (diff)
downloadlinux-93edb8c7f94fb3d384790ac8a83c3fb9389f6ca5.tar.gz
linux-93edb8c7f94fb3d384790ac8a83c3fb9389f6ca5.tar.bz2
linux-93edb8c7f94fb3d384790ac8a83c3fb9389f6ca5.zip
gtp: reload GTPv1 header after pskb_may_pull()
The GTPv1 header flags indicate the presence of optional extensions after this header. Refresh the pointer to the GTPv1 header as skb->head might have be reallocated via pskb_may_pull(). Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)") Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gtp.c')
-rw-r--r--drivers/net/gtp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 8ce1104e4fdb..f7caf1e35d83 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -253,6 +253,8 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
if (!pskb_may_pull(skb, hdrlen))
return -1;
+ gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr));
+
rcu_read_lock();
pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));
if (!pctx) {