From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Gleb Chesnokov <Chesnokov.G@raidix.com>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
jejb@linux.ibm.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.17 02/23] scsi: qla2xxx: Fix missed DMA unmap for aborted commands
Date: Wed, 18 May 2022 08:26:15 -0400 [thread overview]
Message-ID: <20220518122641.342120-2-sashal@kernel.org> (raw)
In-Reply-To: <20220518122641.342120-1-sashal@kernel.org>
From: Gleb Chesnokov <Chesnokov.G@raidix.com>
[ Upstream commit 26f9ce53817a8fd84b69a73473a7de852a24c897 ]
Aborting commands that have already been sent to the firmware can
cause BUG in qlt_free_cmd(): BUG_ON(cmd->sg_mapped)
For instance:
- Command passes rdx_to_xfer state, maps sgl, sends to the firmware
- Reset occurs, qla2xxx performs ISP error recovery, aborts the command
- Target stack calls qlt_abort_cmd() and then qlt_free_cmd()
- BUG_ON(cmd->sg_mapped) in qlt_free_cmd() occurs because sgl was not
unmapped
Thus, unmap sgl in qlt_abort_cmd() for commands with the aborted flag set.
Link: https://lore.kernel.org/r/AS8PR10MB4952D545F84B6B1DFD39EC1E9DEE9@AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Gleb Chesnokov <Chesnokov.G@raidix.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/qla2xxx/qla_target.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index b109716d44fb..7ab3c9e4d478 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3837,6 +3837,9 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd)
spin_lock_irqsave(&cmd->cmd_lock, flags);
if (cmd->aborted) {
+ if (cmd->sg_mapped)
+ qlt_unmap_sg(vha, cmd);
+
spin_unlock_irqrestore(&cmd->cmd_lock, flags);
/*
* It's normal to see 2 calls in this path:
--
2.35.1
next prev parent reply other threads:[~2022-05-18 12:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 12:26 [PATCH AUTOSEL 5.17 01/23] scsi: scsi_dh_alua: Properly handle the ALUA transitioning state Sasha Levin
2022-05-18 12:26 ` Sasha Levin [this message]
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 03/23] mac80211: fix rx reordering with non explicit / psmp ack policy Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 04/23] nl80211: validate S1G channel width Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 05/23] cfg80211: retrieve S1G operating channel number Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 06/23] selftests: add ping test with ping_group_range tuned Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 07/23] Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered" Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 08/23] fbdev: Prevent possible use-after-free in fb_release() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 09/23] platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 10/23] platform/x86: thinkpad_acpi: Correct dual fan probe Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 11/23] platform/x86/intel: Fix 'rmmod pmt_telemetry' panic Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 12/23] platform/surface: gpe: Add support for Surface Pro 8 Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 13/23] drm/amd/display: undo clearing of z10 related function pointers Sasha Levin
2022-05-18 12:36 ` VURDIGERENATARAJ, CHANDAN
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 14/23] net: fix wrong network header length Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 15/23] nl80211: fix locking in nl80211_set_tx_bitrate_mask() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 16/23] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 17/23] net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 18/23] net: atlantic: fix "frag[0] not initialized" Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 19/23] net: atlantic: reduce scope of is_rsc_complete Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 20/23] net: atlantic: add check for MAX_SKB_FRAGS Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 21/23] net: atlantic: verify hw_head_ lies within TX buffer ring Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 22/23] arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 23/23] usb: gadget: fix race when gadget driver register via ioctl Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220518122641.342120-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Chesnokov.G@raidix.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox