]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/ena: fix potential access to freed memory during device reset
authorNetanel Belgazal <netanel@annapurnalabs.com>
Thu, 9 Feb 2017 13:21:33 +0000 (15:21 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 05:27:05 +0000 (21:27 -0800)
commit30e9dad38f0ae12e7c6982f69e7dff19898c4129
tree82a76ff6b87e097e9c7d13d232272f37a5f7cca3
parent8831626a89200ab842bd16526ed5dd54d914c503
net/ena: fix potential access to freed memory during device reset

Orabug: 25535122

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: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/amazon/ena/ena_netdev.c