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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <473B2EAA.4090802@rtr.ca>
Date:	Wed, 14 Nov 2007 12:21:46 -0500
From:	Mark Lord <lkml@....ca>
To:	Sebastian Kemper <sebastian_ml@....net>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing

Sebastian Kemper wrote:
> Hi Mark!
> 
> On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
>> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
>> which means "host error".
>>
>> In this case, that's because the cmd_len is (16), which is too large for 
>> ATAPI.
>> It needs to be changed to (12) instead.
> 
> I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
..

Really?  Where?


> And why does it work with the "old" ATA driver and not with libata if
> 16 is too large for ATAPI in general?
..

Now that *is* the question.
And the answer appears to be that ide-cd.c ignores the passed-in cmd_len,
and replaces it with:

   cmd_len = COMMAND_SIZE(rq->cmd[0]);

That's a SCSI macro to calculate the correct cmd_len based on the SCSI opcode,
which is very appropriate here.   We should do that too (we don't) in libata.

But not exactly as IDE does it -- that's actually a bug:  the code needs to also
check that the new cmd_len is no larger than the original, or we'll get an Oops.

I'll cook up a patch for that shortly and try it before posting it here.

-ml
-
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