]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net/ena: fix potential access to freed memory during device reset
authorNetanel Belgazal <netanel@annapurnalabs.com>
Mon, 13 Feb 2017 23:10:05 +0000 (15:10 -0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 6 Apr 2017 08:25:56 +0000 (09:25 +0100)
commit0618d5f86f309241bfd5cff5b1873a776716e5d3
treea0e31e4b8809a20e380964d76e0f36a4664fd37c
parent3c557f4643a73efe62ec141450be62184d1d3a02
net/ena: fix potential access to freed memory during device reset

BugLink: http://bugs.launchpad.net/bugs/1664312
If the ena driver detects that the device is not behave as expected,
it tries to reset the device.
The reset flow calls ena_down, which will frees all the resources
the driver allocates and then it will reset the device.

This flow can cause memory corruption if the device is still writes
to the driver's memory space.
To overcome this potential race, move the reset before the device
resources are freed.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3f6159dbfc24c5e61fb5deb9b69e0abb934609bb)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/ethernet/amazon/ena/ena_netdev.c