]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: fix a potential use after free in gre_offload.c
authorLi RongQing <roy.qing.li@gmail.com>
Sat, 18 Oct 2014 09:26:04 +0000 (17:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Oct 2014 17:04:08 +0000 (13:04 -0400)
commit9bc02262930fe9530e8b656a7313ca40808b1caf
tree8eb99932d3c7af0461a93467ad8b3f0549745d69
parent7fdeb80a4d8a8e326dc14e9661d26bdf894dc83f
ipv4: fix a potential use after free in gre_offload.c

pskb_may_pull() may change skb->data and make greh pointer oboslete;
so need to reassign greh;
but since first calling pskb_may_pull already ensured that skb->data
has enough space for greh, so move the reference of greh before second
calling pskb_may_pull(), to avoid reassign greh.

Fixes: c967b13b1b("ipv4: fix tunneled VM traffic over hw VXLAN/GRE GSO NIC")
Cc: Wei-Chun Chao <weichunc@plumgrid.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/gre_offload.c