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] [thread-next>] [day] [month] [year] [list]
Message-ID: <996f1de7010aa3ebfd334fb09562944550f894c3.camel@linux.ibm.com>
Date:   Wed, 18 Aug 2021 10:27:01 -0400
From:   James Bottomley <jejb@...ux.ibm.com>
To:     John Garry <john.garry@...wei.com>, mdr@....com,
        martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        bvanassche@....org
Subject: Re: [PATCH 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues

On Wed, 2021-08-18 at 21:53 +0800, John Garry wrote:
> The driver does not compile under DEBUG_QLA1280 flag, so fix up with
> as
> little fuss as possible some debug statements.
> 
> Also delete ql1280_dump_device(), which looks to have never been
> referenced.
> 
> Signed-off-by: John Garry <john.garry@...wei.com>
> ---
>  drivers/scsi/qla1280.c | 39 ++++++++-------------------------------
>  1 file changed, 8 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> index b4f7d8d7a01c..27b16ec399cd 100644
> --- a/drivers/scsi/qla1280.c
> +++ b/drivers/scsi/qla1280.c
> @@ -2807,7 +2807,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host
> *ha, struct srb * sp)
>  
>  	dprintk(2, "start: cmd=%p sp=%p CDB=%xm, handle %lx\n", cmd,
> sp,
>  		cmd->cmnd[0], (long)CMD_HANDLE(sp->cmd));
> -	dprintk(2, "             bus %i, target %i, lun %i\n",
> +	dprintk(2, "             bus %i, target %i, lun %lld\n",
>  		SCSI_BUS_32(cmd), SCSI_TCN_32(cmd), SCSI_LUN_32(cmd));
>  	qla1280_dump_buffer(2, cmd->cmnd, MAX_COMMAND_SIZE);
>  
> @@ -2879,7 +2879,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host
> *ha, struct srb * sp)
>  			remseg--;
>  		}
>  		dprintk(5, "qla1280_64bit_start_scsi: Scatter/gather "
> -			"command packet data - b %i, t %i, l %i \n",
> +			"command packet data - b %i, t %i, l %lld \n",
>  			SCSI_BUS_32(cmd), SCSI_TCN_32(cmd),
>  			SCSI_LUN_32(cmd));

These are the wrong fixes, I think.  The qla1280 can only cope with 32
bits, which is why all the macros have an _32.  Over the years we've
expanded the values in the SCSI command to be 64 bit but by and large,
the truncation in this driver is silent.  However, the correct fix
should be to make the truncation explicit in the macro, so

#define SCSI_LUN_32(Cmnd)	((int)Cmnd->device->lun)

And the same for all the other _32 macros.  This avoids the unexpected
outcome that the _32 macros are actually returning 64 bits and cause me
to do a WTF at your %lld change.

James


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ