datapath: fix a use after free
authorPravin B Shelar <pshelar@nicira.com>
Fri, 17 Oct 2014 22:02:27 +0000 (15:02 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 17 Oct 2014 22:02:27 +0000 (15:02 -0700)
commitc61ecc0709f2b39c68a681d4a1f8dd1299e199d0
tree8b57c663a4c470354ce1b6f5dccb3b83a15b0bbe
parentbf82d5560e38403b8b33a1a846b2fbf4ab891af8
datapath: fix a use after free

pskb_may_pull() called by arphdr_ok can change skb->data, so put the arp
setting after arphdr_ok to avoid the use the freed memory

Fixes: 0714812134d7d ("openvswitch: Eliminate memset() from flow_extract.")
Cc: Jesse Gross <jesse@nicira.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arphdr_ok() was not done on branch-2.3, so backported whole fix
as part of this patch.

Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/flow.c