From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0049.outbound.protection.outlook.com ([104.47.40.49]:58990 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934295AbdC3QTD (ORCPT ); Thu, 30 Mar 2017 12:19:03 -0400 Date: Thu, 30 Mar 2017 09:18:53 -0700 (PDT) From: Himanshu Madhani To: Greg KH cc: stable@vger.kernel.org Subject: Re: [PATCH 2/2] qla2xxx: Fix inadequate lock protection for ABTS. In-Reply-To: <20170330083847.GA21543@kroah.com> Message-ID: References: <20170328195020.12920-1-himanshu.madhani@cavium.com> <20170328195020.12920-3-himanshu.madhani@cavium.com> <20170330083847.GA21543@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: stable-owner@vger.kernel.org List-ID: On Thu, 30 Mar 2017, 1:38am, Greg KH wrote: > On Tue, Mar 28, 2017 at 12:50:20PM -0700, Himanshu Madhani wrote: > > From: Quinn Tran > > > > commit 8f6fc8d4e7ae2347d6261d11a7eb2b247d2954d8 upstream. > > > > Normally, ABTS is sent to Target Core as Task MGMT command. > > In the case of error, qla2xxx needs to send response, hardware_lock > > is required to prevent request queue corruption. > > > > Cc: > > Signed-off-by: Quinn Tran > > Signed-off-by: Himanshu Madhani > > --- > > drivers/scsi/qla2xxx/qla_target.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c > > index 26fe9cb3a963..e2e71e0de857 100644 > > --- a/drivers/scsi/qla2xxx/qla_target.c > > +++ b/drivers/scsi/qla2xxx/qla_target.c > > @@ -120,6 +120,9 @@ static void qlt_send_notify_ack(struct scsi_qla_host *vha, > > uint16_t srr_flags, uint16_t srr_reject_code, uint8_t srr_explan); > > static void qlt_send_term_imm_notif(struct scsi_qla_host *vha, > > struct imm_ntfy_from_isp *imm, int ha_locked); > > +static void qlt_24xx_handle_abts(struct scsi_qla_host *, > > + struct abts_recv_from_24xx *); > > + > > /* > > * Global Variables > > */ > > @@ -357,6 +360,8 @@ void qlt_response_pkt_all_vps(struct scsi_qla_host *vha, response_t *pkt) > > (struct abts_recv_from_24xx *)pkt; > > struct scsi_qla_host *host = qlt_find_host_by_vp_idx(vha, > > entry->vp_index); > > + unsigned long flags; > > + > > if (unlikely(!host)) { > > ql_dbg(ql_dbg_tgt, vha, 0xe044, > > "qla_target(%d): Response pkt " > > @@ -364,7 +369,11 @@ void qlt_response_pkt_all_vps(struct scsi_qla_host *vha, response_t *pkt) > > "vp_index %d\n", vha->vp_idx, entry->vp_index); > > break; > > } > > - qlt_response_pkt(host, pkt); > > + if (!ha_locked) > > + spin_lock_irqsave(&host->hw->hardware_lock, flags); > > + qlt_24xx_handle_abts(host, (struct abts_recv_from_24xx *)atio); > > + if (!ha_locked) > > + spin_unlock_irqrestore(&host->hw->hardware_lock, flags); > > break; > > } > > > > You didn't test build this patch did you :( > > Please do so, it breaks the build here on my end. I'll drop it from my > queue, please fix this up _properly_ and resend after you have tested it > out. > Apologies for the wrong backport. Looks like original patch has not yet made it into 4.10 stable. So this backport is not needed at this time. Sorry for the noise. > thanks, > > greg k-h > Thanks, - Himanshu