lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <748125.31172.qm@web33007.mail.mud.yahoo.com>
Date:	Wed, 16 Dec 2009 14:53:03 -0800 (PST)
From:	Stephen Cameron <smcameron@...oo.com>
To:	James.Bottomley@...senPartnership.com, akpm@...ux-foundation.org,
	"Stephen M. Cameron" <scameron@...rdog.cce.hp.com>
Cc:	linux-kernel@...r.kernel.org, mikem@...rdog.cce.hp.com,
	linux-scsi@...r.kernel.org
Subject: Re: [PATCH 4/5] hpsa: Fix incorrect SCSI status reporting



--- On Tue, 12/8/09, Stephen M. Cameron <scameron@...rdog.cce.hp.com> wrote:

> From: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
> Subject: [PATCH 4/5] hpsa: Fix incorrect SCSI status reporting
> To: James.Bottomley@...senPartnership.com, akpm@...ux-foundation.org
> Cc: linux-kernel@...r.kernel.org, mikem@...rdog.cce.hp.com, linux-scsi@...r.kernel.org, smcameron@...oo.com
> Date: Tuesday, December 8, 2009, 3:38 PM
> From: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
> 
> hpsa: Fix incorrect SCSI status reporting
> 
> Signed-off-by: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
> ---
>  drivers/scsi/hpsa.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 0e696ee..380236a 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -930,7 +930,7 @@ static void
> complete_scsi_command(struct CommandList *cp,
>  
>      cmd->result = (DID_OK << 16);
>         /* host byte */
>      cmd->result |= (COMMAND_COMPLETE << 8);    /* msg byte */
> -    cmd->result |= (ei->ScsiStatus);
> +    cmd->result |= (ei->ScsiStatus << 1);

I don't think this is correct.

I got fooled by some code in other drivers (3w-9xxx.c, gdth.c)
which use CHECK_CONDITION, and shift it left 1, but I failed to notice
that CHECK_CONDITION is defined to be 0x01, not 0x02.

Might be nice if there were some macros or helper functions
for setting the status bytes in scsi.h (there are some for 
unpacking, but not for packing, but drivers mainly need to
pack these, not unpack them.)

Will send a patch tomorrow in any case.

-- steve



>  
>      /* copy the sense data whether we need
> to or not. */
>      memcpy(cmd->sense_buffer,
> ei->SenseInfo,
> @@ -991,7 +991,6 @@ static void
> complete_scsi_command(struct CommandList *cp,
>  
>  
>             
> /* Must be some other type of check condition */
> -           
> cmd->result |= (ei->ScsiStatus << 1);
>             
> dev_warn(&h->pdev->dev, "cp %p has check
> condition: "
>             
>         "unknown type: "
>             
>         "Sense: 0x%x, ASC:
> 0x%x, ASCQ: 0x%x, "
> @@ -1013,8 +1012,6 @@ static void
> complete_scsi_command(struct CommandList *cp,
>           * Pass it
> up to the upper layers...
>           */
>          if
> (ei->ScsiStatus) {
> -
> -           
> cmd->result |= (ei->ScsiStatus << 1);
>             
> dev_warn(&h->pdev->dev, "cp %p has status 0x%x "
>             
>     "Sense: 0x%x, ASC: 0x%x, ASCQ: 0x%x, "
>             
>     "Returning result: 0x%x\n",
> 
> 


      
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ