All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree
@ 2017-03-24  7:51 gregkh
  2017-03-31  7:45 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2017-03-24  7:51 UTC (permalink / raw)
  To: quinn.tran, himanshu.madhani, nab, stable; +Cc: stable


The patch below does not apply to the 4.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 8f6fc8d4e7ae2347d6261d11a7eb2b247d2954d8 Mon Sep 17 00:00:00 2001
From: Quinn Tran <quinn.tran@cavium.com>
Date: Wed, 15 Mar 2017 09:48:46 -0700
Subject: [PATCH] qla2xxx: Fix inadequate lock protection for ABTS.

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: <stable@vger.kernel.org>
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index a463bcc57902..a78c3e9bcb57 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -130,6 +130,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
 static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha,
 	fc_port_t *fcport, bool local);
 void qlt_unreg_sess(struct fc_port *sess);
+static void qlt_24xx_handle_abts(struct scsi_qla_host *,
+	struct abts_recv_from_24xx *);
+
 /*
  * Global Variables
  */
@@ -389,6 +392,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
 			(struct abts_recv_from_24xx *)atio;
 		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, 0xffff,
 			    "qla_target(%d): Response pkt (ABTS_RECV_24XX) "
@@ -396,9 +401,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
 			    vha->vp_idx, entry->vp_index);
 			break;
 		}
-		qlt_response_pkt(host, (response_t *)atio);
+		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;
-
 	}
 
 	/* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree
  2017-03-24  7:51 FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree gregkh
@ 2017-03-31  7:45 ` Nicholas A. Bellinger
  2017-03-31 14:16   ` Madhani, Himanshu
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas A. Bellinger @ 2017-03-31  7:45 UTC (permalink / raw)
  To: gregkh; +Cc: quinn.tran, himanshu.madhani, stable, target-devel

Hi Quinn & Himanshu,

On Fri, 2017-03-24 at 08:51 +0100, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 4.10-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h

This looks like a pretty somple backport to v4.10.y stable code.

Can someone send out an updated version to Greg-KH + stable team so it
can be picked up for v4.10.y and earlier stable releases..?

Thank you,

> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 8f6fc8d4e7ae2347d6261d11a7eb2b247d2954d8 Mon Sep 17 00:00:00 2001
> From: Quinn Tran <quinn.tran@cavium.com>
> Date: Wed, 15 Mar 2017 09:48:46 -0700
> Subject: [PATCH] qla2xxx: Fix inadequate lock protection for ABTS.
> 
> 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: <stable@vger.kernel.org>
> Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index a463bcc57902..a78c3e9bcb57 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -130,6 +130,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
>  static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha,
>  	fc_port_t *fcport, bool local);
>  void qlt_unreg_sess(struct fc_port *sess);
> +static void qlt_24xx_handle_abts(struct scsi_qla_host *,
> +	struct abts_recv_from_24xx *);
> +
>  /*
>   * Global Variables
>   */
> @@ -389,6 +392,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
>  			(struct abts_recv_from_24xx *)atio;
>  		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, 0xffff,
>  			    "qla_target(%d): Response pkt (ABTS_RECV_24XX) "
> @@ -396,9 +401,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
>  			    vha->vp_idx, entry->vp_index);
>  			break;
>  		}
> -		qlt_response_pkt(host, (response_t *)atio);
> +		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;
> -
>  	}
>  
>  	/* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree
  2017-03-31  7:45 ` Nicholas A. Bellinger
@ 2017-03-31 14:16   ` Madhani, Himanshu
  2017-04-02 23:21     ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: Madhani, Himanshu @ 2017-03-31 14:16 UTC (permalink / raw)
  To: Nicholas A. Bellinger; +Cc: Greg KH, Tran, Quinn, stable, target-devel

Hi Nic, 

> On Mar 31, 2017, at 12:45 AM, Nicholas A. Bellinger <nab@linux-iscsi.org> wrote:
> 
> Hi Quinn & Himanshu,
> 
> On Fri, 2017-03-24 at 08:51 +0100, gregkh@linuxfoundation.org wrote:
>> The patch below does not apply to the 4.10-stable tree.
>> If someone wants it applied there, or to any other stable or longterm
>> tree, then please email the backport, including the original git commit
>> id to <stable@vger.kernel.org>.
>> 
>> thanks,
>> 
>> greg k-h
> 
> This looks like a pretty somple backport to v4.10.y stable code.
> 
> Can someone send out an updated version to Greg-KH + stable team so it
> can be picked up for v4.10.y and earlier stable releases..?
> 

I had sent back port to Greg, but the patch which introduced issue 

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/scsi/qla2xxx?id=41dc529a4602ac737020f423f84686a81de38e6d

was not present in 4.10.x stable yet. So we do not need to back port this patch to stable.

> Thank you,
> 
>> 
>> ------------------ original commit in Linus's tree ------------------
>> 
>> From 8f6fc8d4e7ae2347d6261d11a7eb2b247d2954d8 Mon Sep 17 00:00:00 2001
>> From: Quinn Tran <quinn.tran@cavium.com>
>> Date: Wed, 15 Mar 2017 09:48:46 -0700
>> Subject: [PATCH] qla2xxx: Fix inadequate lock protection for ABTS.
>> 
>> 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: <stable@vger.kernel.org>
>> Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
>> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
>> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
>> 
>> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
>> index a463bcc57902..a78c3e9bcb57 100644
>> --- a/drivers/scsi/qla2xxx/qla_target.c
>> +++ b/drivers/scsi/qla2xxx/qla_target.c
>> @@ -130,6 +130,9 @@ static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
>> static struct fc_port *qlt_create_sess(struct scsi_qla_host *vha,
>> 	fc_port_t *fcport, bool local);
>> void qlt_unreg_sess(struct fc_port *sess);
>> +static void qlt_24xx_handle_abts(struct scsi_qla_host *,
>> +	struct abts_recv_from_24xx *);
>> +
>> /*
>>  * Global Variables
>>  */
>> @@ -389,6 +392,8 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
>> 			(struct abts_recv_from_24xx *)atio;
>> 		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, 0xffff,
>> 			    "qla_target(%d): Response pkt (ABTS_RECV_24XX) "
>> @@ -396,9 +401,12 @@ static bool qlt_24xx_atio_pkt_all_vps(struct scsi_qla_host *vha,
>> 			    vha->vp_idx, entry->vp_index);
>> 			break;
>> 		}
>> -		qlt_response_pkt(host, (response_t *)atio);
>> +		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;
>> -
>> 	}
>> 
>> 	/* case PUREX_IOCB_TYPE: ql2xmvasynctoatio */
>> 
> 
> 

Thanks,
- Himanshu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree
  2017-03-31 14:16   ` Madhani, Himanshu
@ 2017-04-02 23:21     ` Nicholas A. Bellinger
  0 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2017-04-02 23:21 UTC (permalink / raw)
  To: Madhani, Himanshu; +Cc: Greg KH, Tran, Quinn, stable, target-devel

On Fri, 2017-03-31 at 14:16 +0000, Madhani, Himanshu wrote:
> Hi Nic, 
> 
> > On Mar 31, 2017, at 12:45 AM, Nicholas A. Bellinger <nab@linux-iscsi.org> wrote:
> > 
> > Hi Quinn & Himanshu,
> > 
> > On Fri, 2017-03-24 at 08:51 +0100, gregkh@linuxfoundation.org wrote:
> >> The patch below does not apply to the 4.10-stable tree.
> >> If someone wants it applied there, or to any other stable or longterm
> >> tree, then please email the backport, including the original git commit
> >> id to <stable@vger.kernel.org>.
> >> 
> >> thanks,
> >> 
> >> greg k-h
> > 
> > This looks like a pretty somple backport to v4.10.y stable code.
> > 
> > Can someone send out an updated version to Greg-KH + stable team so it
> > can be picked up for v4.10.y and earlier stable releases..?
> > 
> 
> I had sent back port to Greg, but the patch which introduced issue 
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/scsi/qla2xxx?id=41dc529a4602ac737020f423f84686a81de38e6d
> 
> was not present in 4.10.x stable yet. So we do not need to back port this patch to stable.

Thanks for clarifying, I was just double-checking.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-02 23:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24  7:51 FAILED: patch "[PATCH] qla2xxx: Fix inadequate lock protection for ABTS." failed to apply to 4.10-stable tree gregkh
2017-03-31  7:45 ` Nicholas A. Bellinger
2017-03-31 14:16   ` Madhani, Himanshu
2017-04-02 23:21     ` Nicholas A. Bellinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.