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: <101516.95411.qm@web83205.mail.mud.yahoo.com>
Date:	Fri, 1 Aug 2008 11:46:04 -0700 (PDT)
From:	Matthew Frost <artusemrys@...global.net>
To:	Alan Stern <stern@...land.harvard.edu>,
	Douglas Gilbert <dougg@...que.net>
Cc:	James Bottomley <James.Bottomley@...senPartnership.com>,
	Matthew Dharm <mdharm-kernel@...-eyed-alien.net>,
	Matthew Frost <artusemrys@...oo.com>,
	USB Storage list <usb-storage@...ts.one-eyed-alien.net>,
	linux-kernel@...r.kernel.org,
	linux-scsi <linux-scsi@...r.kernel.org>,
	Matt Frost <artusemrys@...global.net>
Subject: Re: [usb-storage] BUG: SCSI: usb storage SDHC card doesn't work in 2.6.27-rc1

Alan Stern wrote:
> > The patches to fix this that I have tried do not apply
> > cleanly to lk 2.6.26 (and break during compile if forced:
> > "us->fflags" is not defined).
> > 
> > Is there a lk 2.6.26 patch available?
> 
> Sorry about that; my patches are against the USB development tree and
> I tend to forget to redo them against the vanilla kernel.  Below is a
> patch against 2.6.26.  Or you can just edit the original patch and
> change the occurrences of "fflags" to "flags".
> 
> Alan Stern
> 
> 
> Index: 2.6.26/drivers/usb/storage/transport.c
> ===================================================================
> --- 2.6.26.orig/drivers/usb/storage/transport.c
> +++ 2.6.26/drivers/usb/storage/transport.c
> @@ -1034,8 +1034,21 @@ int usb_stor_Bulk_transport(struct scsi_
>  
>  	/* try to compute the actual residue, based on how much data
>  	 * was really transferred and what the device tells us */
> -	if (residue) {
> -		if (!(us->flags & US_FL_IGNORE_RESIDUE)) {
> +	if (residue && !(us->flags & US_FL_IGNORE_RESIDUE)) {
> +
> +		/* Heuristically detect devices that generate bogus residues
> +		 * by seeing what happens with INQUIRY and READ CAPACITY
> +		 * commands.
> +		 */
> +		if (bcs->Status == US_BULK_STAT_OK &&
> +				scsi_get_resid(srb) == 0 &&
> +					((srb->cmnd[0] == INQUIRY &&
> +						transfer_length == 36) ||
> +					(srb->cmnd[0] == READ_CAPACITY &&
> +						transfer_length == 8))) {
> +			us->flags |= US_FL_IGNORE_RESIDUE;
> +
> +		} else {
>  			residue = min(residue, transfer_length);
>  			scsi_set_resid(srb, max(scsi_get_resid(srb),
>  			                                       (int) residue));
> 
> 

Thanks!  I've been trying to fix it manually, and it wouldn't work.  Trying
this version now.  Let's see if this fixes my problem.

Matt Frost
--
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