geneve: avoid use-after-free of skb->data
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 2 Dec 2016 15:49:29 +0000 (16:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Dec 2016 18:07:24 +0000 (19:07 +0100)
commit6e682c528b3ef046a03994b076d832b2ac029042
tree816e6aa13cc30e06a1514464a121e043d207de43
parenta89e2ff894bc317a49b9b46ef70eb62e05a8bf7c
geneve: avoid use-after-free of skb->data

[ Upstream commit 5b01014759991887b1e450c9def01e58c02ab81b ]

geneve{,6}_build_skb can end up doing a pskb_expand_head(), which
makes the ip_hdr(skb) reference we stashed earlier stale. Since it's
only needed as an argument to ip_tunnel_ecn_encap(), move this
directly in the function call.

Fixes: 08399efc6319 ("geneve: ensure ECN info is handled properly in all tx/rx paths")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/geneve.c