]> 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)
commite32714c2bbaa7922e2eb68a5f78c98f9cae9fb67
treeeb166e6f5b5eba6bccde25861235626fdb67b0a8
parent1c8d0a537edfe7b57f29340c24eebc7386ecf936
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