]> git.baikalelectronics.ru Git - kernel.git/commit
qlcnic: fix data structure corruption in async mbx command handling
authorManish Chopra <manish.chopra@qlogic.com>
Wed, 3 Aug 2016 08:02:02 +0000 (04:02 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Aug 2016 19:03:35 +0000 (12:03 -0700)
commit4b99b289b91e083307dff5f0c1d0f2598d0b4ac4
treeeb166e6f5b5eba6bccde25861235626fdb67b0a8
parentacad42e49882232af92f8e3145014f4ebd712d0d
qlcnic: fix data structure corruption in async mbx command handling

This patch fixes a data structure corruption bug in the SRIOV VF mailbox
handler code. While handling mailbox commands from the atomic context,
driver is accessing and updating qlcnic_async_work_list_struct entry fields
in the async work list. These fields could be concurrently accessed by the
work function resulting in data corruption.

This patch restructures async mbx command handling by using a separate
async command list instead of using a list of work_struct structures.
A single work_struct is used to schedule and handle the async commands
with proper locking mechanism.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c