Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 772ed869 authored by Netanel Belgazal's avatar Netanel Belgazal Committed by David S. Miller
Browse files

net: ena: fix surprise unplug NULL dereference kernel crash



Starting with driver version 1.5.0, in case of a surprise device
unplug, there is a race caused by invoking ena_destroy_device()
from two different places. As a result, the readless register might
be accessed after it was destroyed.

Signed-off-by: default avatarNetanel Belgazal <netanel@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5cf4a853
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3409,12 +3409,12 @@ static void ena_remove(struct pci_dev *pdev)
		netdev->rx_cpu_rmap = NULL;
	}
#endif /* CONFIG_RFS_ACCEL */

	unregister_netdev(netdev);
	del_timer_sync(&adapter->timer_service);

	cancel_work_sync(&adapter->reset_task);

	unregister_netdev(netdev);

	/* Reset the device only if the device is running. */
	if (test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags))
		ena_com_dev_reset(ena_dev, adapter->reset_reason);