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]
Date:   Fri, 28 Dec 2018 11:00:36 -0500 (EST)
From:   Alan Stern <stern@...land.harvard.edu>
To:     Icenowy Zheng <icenowy@...c.io>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        <linux-usb@...r.kernel.org>,
        <usb-storage@...ts.one-eyed-alien.net>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] USB: storage: don't insert sane sense for SPC3+ when
 bad sense specified

On Thu, 27 Dec 2018, Icenowy Zheng wrote:

> Currently the code will set US_FL_SANE_SENSE flag unconditionally if
> device claims SPC3+, however we should allow US_FL_BAD_SENSE flag to
> prevent this behavior, because SMI SM3350 UFS-USB bridge controller,
> which claims SPC4, will show strange behavior with 96-byte sense
> (put the chip into a wrong state that cannot read/write anything).
> 
> Check the presence of US_FL_BAD_SENSE when assuming US_FL_SANE_SENSE on
> SPC4+ devices.
> 
> Signed-off-by: Icenowy Zheng <icenowy@...c.io>
> ---
>  drivers/usb/storage/scsiglue.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index fde2e71a6ade..699fe9557127 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -236,7 +236,8 @@ static int slave_configure(struct scsi_device *sdev)
>  			sdev->try_rc_10_first = 1;
>  
>  		/* assume SPC3 or latter devices support sense size > 18 */
> -		if (sdev->scsi_level > SCSI_SPC_2)
> +		if (sdev->scsi_level > SCSI_SPC_2 &&
> +		    !(us->fflags & US_FL_BAD_SENSE))
>  			us->fflags |= US_FL_SANE_SENSE;

Please update the comment so that it matches the new code.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ