]> git.baikalelectronics.ru Git - kernel.git/commit
net/esp4: Fix invalid esph pointer crash
authorIlan Tayari <ilant@mellanox.com>
Sun, 30 Apr 2017 13:34:38 +0000 (16:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 18:58:50 +0000 (14:58 -0400)
commit6737db4c894153bce5fa00a4c196273e4c7a7bd7
tree21e78406f0e8486ea8ccee0baa9adc4d7d93fe92
parent9e183c130cac82231c97d7047e3a6cd070fcc9be
net/esp4: Fix invalid esph pointer crash

Both esp_output and esp_xmit take a pointer to the ESP header
and place it in esp_info struct prior to calling esp_output_head.

Inside esp_output_head, the call to esp_output_udp_encap
makes sure to update the pointer if it gets invalid.
However, if esp_output_head itself calls skb_cow_data, the
pointer is not updated and stays invalid, causing a crash
after esp_output_head returns.

Update the pointer if it becomes invalid in esp_output_head

Fixes: d338eb9168cc ("esp4: Reorganize esp_output")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/esp4.c