]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix race condition between device reset and link up setup
authorNetanel Belgazal <netanel@amazon.com>
Sun, 19 Nov 2017 18:03:40 +0000 (18:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Nov 2017 02:35:16 +0000 (11:35 +0900)
commitb778d11c69d33428e0d4d00e95ee84519e7966ab
tree4a0c4bd707bf32ee2b72f6574906b4847bebbb51
parentc0f53f473ff454f31a35358bac632dabde3a8d60
net: ena: fix race condition between device reset and link up setup

In rare cases, ena driver would reset and re-start the device,
for example, in case of misbehaving application that causes
transmit timeout

The first step in the reset procedure is to stop the Tx traffic by
calling ena_carrier_off().

After the driver have just started the device reset procedure, device
happens to send an asynchronous notification (via AENQ) to the driver
than there was a link change (to link-up state).
This link change is mapped to a call to netif_carrier_on() which
re-activates the Tx queues, violating the assumption of no tx traffic
until device reset is completed, as the reset task might still be in
the process of queues initialization, leading to an access to
uninitialized memory.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amazon/ena/ena_netdev.h