public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value
@ 2024-10-03  3:29 Finn Thain
  2024-10-03  7:07 ` Michael Schmitz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Finn Thain @ 2024-10-03  3:29 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Daniel Palmer, Michael Schmitz, stable, linux-scsi, linux-kernel

From: Daniel Palmer <daniel@0x0f.com>

A regression was introduced with commit dbb2da557a6a ("scsi: wd33c93: Move
the SCSI pointer to private command data") which results in an oops in
wd33c93_intr(). That commit added the scsi_pointer variable and
initialized it from hostdata->connected. However, during selection,
hostdata->connected is not yet valid. Fix this by getting the current
scsi_pointer from hostdata->selecting.

Cc: Daniel Palmer <daniel@0x0f.com>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: stable@kernel.org
Fixes: dbb2da557a6a ("scsi: wd33c93: Move the SCSI pointer to private command data")
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Co-developed-by: Finn Thain <fthain@linux-m68k.org>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
 drivers/scsi/wd33c93.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index a44b60c9004a..dd1fef9226f2 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -831,7 +831,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 		/* construct an IDENTIFY message with correct disconnect bit */
 
 		hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun);
-		if (scsi_pointer->phase)
+		if (WD33C93_scsi_pointer(cmd)->phase)
 			hostdata->outgoing_msg[0] |= 0x40;
 
 		if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) {
-- 
2.39.5


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

* Re: [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value
  2024-10-03  3:29 [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value Finn Thain
@ 2024-10-03  7:07 ` Michael Schmitz
  2024-10-03 16:57 ` Bart Van Assche
  2024-10-04  2:08 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Schmitz @ 2024-10-03  7:07 UTC (permalink / raw)
  To: Finn Thain, James E.J. Bottomley, Martin K. Petersen
  Cc: Daniel Palmer, stable, linux-scsi, linux-kernel

Hi Finn,

looks good to me, so:

Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>

Cheers,

	Michael


Am 03.10.2024 um 16:29 schrieb Finn Thain:
> From: Daniel Palmer <daniel@0x0f.com>
>
> A regression was introduced with commit dbb2da557a6a ("scsi: wd33c93: Move
> the SCSI pointer to private command data") which results in an oops in
> wd33c93_intr(). That commit added the scsi_pointer variable and
> initialized it from hostdata->connected. However, during selection,
> hostdata->connected is not yet valid. Fix this by getting the current
> scsi_pointer from hostdata->selecting.
>
> Cc: Daniel Palmer <daniel@0x0f.com>
> Cc: Michael Schmitz <schmitzmic@gmail.com>
> Cc: stable@kernel.org
> Fixes: dbb2da557a6a ("scsi: wd33c93: Move the SCSI pointer to private command data")
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> Co-developed-by: Finn Thain <fthain@linux-m68k.org>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> ---
>  drivers/scsi/wd33c93.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
> index a44b60c9004a..dd1fef9226f2 100644
> --- a/drivers/scsi/wd33c93.c
> +++ b/drivers/scsi/wd33c93.c
> @@ -831,7 +831,7 @@ wd33c93_intr(struct Scsi_Host *instance)
>  		/* construct an IDENTIFY message with correct disconnect bit */
>
>  		hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun);
> -		if (scsi_pointer->phase)
> +		if (WD33C93_scsi_pointer(cmd)->phase)
>  			hostdata->outgoing_msg[0] |= 0x40;
>
>  		if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) {
>

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

* Re: [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value
  2024-10-03  3:29 [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value Finn Thain
  2024-10-03  7:07 ` Michael Schmitz
@ 2024-10-03 16:57 ` Bart Van Assche
  2024-10-04  2:08 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2024-10-03 16:57 UTC (permalink / raw)
  To: Finn Thain, James E.J. Bottomley, Martin K. Petersen
  Cc: Daniel Palmer, Michael Schmitz, stable, linux-scsi, linux-kernel

On 10/2/24 8:29 PM, Finn Thain wrote:
> diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
> index a44b60c9004a..dd1fef9226f2 100644
> --- a/drivers/scsi/wd33c93.c
> +++ b/drivers/scsi/wd33c93.c
> @@ -831,7 +831,7 @@ wd33c93_intr(struct Scsi_Host *instance)
>   		/* construct an IDENTIFY message with correct disconnect bit */
>   
>   		hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun);
> -		if (scsi_pointer->phase)
> +		if (WD33C93_scsi_pointer(cmd)->phase)
>   			hostdata->outgoing_msg[0] |= 0x40;
>   
>   		if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) {

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value
  2024-10-03  3:29 [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value Finn Thain
  2024-10-03  7:07 ` Michael Schmitz
  2024-10-03 16:57 ` Bart Van Assche
@ 2024-10-04  2:08 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-10-04  2:08 UTC (permalink / raw)
  To: James E.J. Bottomley, Finn Thain
  Cc: Martin K . Petersen, Daniel Palmer, Michael Schmitz, stable,
	linux-scsi, linux-kernel

On Thu, 03 Oct 2024 13:29:47 +1000, Finn Thain wrote:

> A regression was introduced with commit dbb2da557a6a ("scsi: wd33c93: Move
> the SCSI pointer to private command data") which results in an oops in
> wd33c93_intr(). That commit added the scsi_pointer variable and
> initialized it from hostdata->connected. However, during selection,
> hostdata->connected is not yet valid. Fix this by getting the current
> scsi_pointer from hostdata->selecting.
> 
> [...]

Applied to 6.12/scsi-fixes, thanks!

[1/1] scsi: wd33c93: Don't use stale scsi_pointer value
      https://git.kernel.org/mkp/scsi/c/9023ed8d91eb

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2024-10-04  2:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  3:29 [PATCH] scsi: wd33c93: Don't use stale scsi_pointer value Finn Thain
2024-10-03  7:07 ` Michael Schmitz
2024-10-03 16:57 ` Bart Van Assche
2024-10-04  2:08 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox