diff options
| author | Haiyang Zhang <[email protected]> | 2022-12-02 19:43:10 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2022-12-06 10:21:34 +0000 |
| commit | 18010ff776fa42340efc428b3ea6d19b3e7c7b21 (patch) | |
| tree | 4e6f6c28275e3b71daa8d15ca92bf1d794c79773 /drivers/net/wwan/iosm/iosm_ipc_mux.c | |
| parent | net: stmmac: fix "snps,axi-config" node property parsing (diff) | |
| download | kernel-18010ff776fa42340efc428b3ea6d19b3e7c7b21.tar.gz kernel-18010ff776fa42340efc428b3ea6d19b3e7c7b21.zip | |
net: mana: Fix race on per-CQ variable napi work_done
After calling napi_complete_done(), the NAPIF_STATE_SCHED bit may be
cleared, and another CPU can start napi thread and access per-CQ variable,
cq->work_done. If the other thread (for example, from busy_poll) sets
it to a value >= budget, this thread will continue to run when it should
stop, and cause memory corruption and panic.
To fix this issue, save the per-CQ work_done variable in a local variable
before napi_complete_done(), so it won't be corrupted by a possible
concurrent thread after napi_complete_done().
Also, add a flag bit to advertise to the NIC firmware: the NAPI work_done
variable race is fixed, so the driver is able to reliably support features
like busy_poll.
Cc: [email protected]
Fixes: e1b5683ff62e ("net: mana: Move NAPI from EQ to CQ")
Signed-off-by: Haiyang Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_mux.c')
0 files changed, 0 insertions, 0 deletions
