summaryrefslogtreecommitdiff
path: root/drivers/net/wwan/iosm/iosm_ipc_mux.c
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2022-12-02 22:43:10 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-12-06 13:21:34 +0300
commit18010ff776fa42340efc428b3ea6d19b3e7c7b21 (patch)
tree4e6f6c28275e3b71daa8d15ca92bf1d794c79773 /drivers/net/wwan/iosm/iosm_ipc_mux.c
parent61d4f140943c47c1386ed89f7260e00418dfad9d (diff)
downloadlinux-18010ff776fa42340efc428b3ea6d19b3e7c7b21.tar.xz
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: stable@vger.kernel.org Fixes: e1b5683ff62e ("net: mana: Move NAPI from EQ to CQ") Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Link: https://lore.kernel.org/r/1670010190-28595-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_mux.c')
0 files changed, 0 insertions, 0 deletions