From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: Luben Tuikov <ltuikov@yahoo.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-usb@vger.kernel.org, Greg KH <greg@kroah.com>,
James Bottomley <James.Bottomley@suse.de>
Subject: Re: [PATCH repost 3] [SCSI] Retrieve the Caching mode page
Date: Mon, 22 Nov 2010 21:00:48 -0800 [thread overview]
Message-ID: <20101123050048.GL20296@one-eyed-alien.net> (raw)
In-Reply-To: <538170.68988.qm@web31803.mail.mud.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]
On Mon, Nov 22, 2010 at 12:02:26PM -0800, Luben Tuikov wrote:
> --- On Mon, 11/22/10, Linus Torvalds <torvalds@linux-foundation.org>
> wrote:
> > So I don't mind the patch per se, but I think it's potentially way more
> > dangerous than it looks.
>
> This patch does not ask for pages that Windows doesn't ask for. The sd
> driver already asks for all pages (page code 0x3F) and then checks if the
> device is write protected. Here is the present code:
>
> 2217 sd_read_write_protect_flag(sdkp, buffer); 2218
> sd_read_cache_type(sdkp, buffer); 2219
> sd_read_app_tag_own(sdkp, buffer);
>
> Line 2217 asks for page code 0x3F, meaning all mode pages. Line 2218
> asks for the Caching mode page or not at all if the device flags forbid
> it (all USB storage devices in the Linux kernel).
>
> This patch adds processing of the data returned when all mode pages are
> asked for (0x3F) in the function on line 2218. It then parses the data to
> find out if the Caching mode page is present.
As long as you are not changing the command stream that the devices see, I
think this is a reasonable risk to take.
What are the consequences if the device returns what appear to be a Caching
Mode Page, but it is actually filled with garbage or otherwise inaccurate
data?
Matt
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
You suck Stef.
-- Greg
User Friendly, 11/29/97
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2010-11-23 5:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 16:56 [PATCH repost 3] [SCSI] Retrieve the Caching mode page Luben Tuikov
2010-11-22 17:07 ` Linus Torvalds
2010-11-22 19:02 ` Douglas Gilbert
[not found] ` <4CEABE2E.4010609-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
2010-11-23 4:59 ` Matthew Dharm
[not found] ` <20101123045900.GK20296-JGfshJpz5UybPZpvUQj5UqxOck334EZe@public.gmane.org>
2010-11-23 18:40 ` Douglas Gilbert
2010-11-22 20:02 ` Luben Tuikov
2010-11-23 5:00 ` Matthew Dharm [this message]
2010-11-23 9:25 ` Luben Tuikov
[not found] ` <589506.10541.qm-R7kMla0nNtOvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
2010-11-23 14:30 ` Matthew Dharm
2010-11-24 9:02 ` Luben Tuikov
2010-11-24 10:10 ` James Bottomley
2010-11-24 14:48 ` Christoph Hellwig
[not found] ` <1290593429.14652.33.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-11-24 14:49 ` Alan Stern
2010-11-24 14:58 ` James Bottomley
2010-11-24 16:55 ` Luben Tuikov
-- strict thread matches above, loose matches on Subject: below --
2010-11-23 8:43 Luben Tuikov
2010-12-05 20:53 Luben Tuikov
2010-12-08 0:02 Luben Tuikov
2010-12-08 0:12 ` Greg KH
[not found] ` <20101208001202.GA26530-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2010-12-08 5:05 ` James Bottomley
2010-12-08 8:01 ` Luben Tuikov
2010-12-08 15:16 ` Alan Stern
2010-12-08 15:43 ` James Bottomley
[not found] ` <1291823012.24312.52.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-12-08 15:57 ` Alan Stern
2010-12-08 16:00 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101123050048.GL20296@one-eyed-alien.net \
--to=mdharm-kernel@one-eyed-alien.net \
--cc=James.Bottomley@suse.de \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ltuikov@yahoo.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox