* Plextor PowerRec for users
@ 2006-02-12 15:13 Thomas Maguin
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Maguin @ 2006-02-12 15:13 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
Please add the following entries to allow :
command opcodes for PoweRec, VariRec (0xED & 0xEB)
and further settings opcodes 0xE9 on Plextor devices
as normal user.
/usr/src/linux/scsi/scsi.h
+#define PLEXTOR_MODE 0x39
+#define PLEXTOR_PREC_SPEEDS 0x3B
+#define PLEXTOR_MODE2 0x3D
/usr/src/linux/block/scsi/scsi_ioctl.c
+safe_for_read(PLEXTOR_MODE)
+safe_for_read(PLEXTOR_PREC_SPEEDS)
+safe_for_read(PLEXTOR_MODE2)
Thomas Maguin
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Plextor PowerRec for users
@ 2006-02-12 16:18 Thomas Maguin
2006-02-12 16:53 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Maguin @ 2006-02-12 16:18 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 414 bytes --]
Blame on me, a typo in the addresses. Changes should be this:
(patch is on the way)
/usr/src/linux/include/scsi/scsi.h
+#define PLEXTOR_MODE 0xe9
+#define PLEXTOR_PREC_SPEEDS 0xeB
+#define PLEXTOR_MODE2 0xeD
/usr/src/linux/block/scsi/scsi_ioctl.c
+safe_for_read(PLEXTOR_MODE)
+safe_for_read(PLEXTOR_PREC_SPEEDS)
+safe_for_read(PLEXTOR_MODE2)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Plextor PowerRec for users
2006-02-12 16:18 Plextor PowerRec for users Thomas Maguin
@ 2006-02-12 16:53 ` Matthew Wilcox
2006-02-12 18:47 ` Thomas Maguin
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-02-12 16:53 UTC (permalink / raw)
To: Thomas Maguin; +Cc: linux-scsi
On Sun, Feb 12, 2006 at 05:18:04PM +0100, Thomas Maguin wrote:
> Blame on me, a typo in the addresses. Changes should be this:
> (patch is on the way)
>
> /usr/src/linux/include/scsi/scsi.h
> +#define PLEXTOR_MODE ?? ?? ?? ?? ?? ?? ?? ?? ??0xe9
> +#define PLEXTOR_PREC_SPEEDS ?? 0xeB
> +#define PLEXTOR_MODE2 ?? ?? ?? ?? ?? ?? ?? ??0xeD
>
> /usr/src/linux/block/scsi/scsi_ioctl.c
> +safe_for_read(PLEXTOR_MODE)
> +safe_for_read(PLEXTOR_PREC_SPEEDS)
> +safe_for_read(PLEXTOR_MODE2)
The trouble is that these are vendor-specific commands. So they're safe
*for plextor devices*, but they may well be unsafe for other vendors.
Given the LG CD-ROM snafu [1], I'd expect people to err on the side
of caution. Sorry.
[1] http://www.dvd-recordable.org/Article911-mode=thread-order0-threshold0.phtml
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Plextor PowerRec for users
2006-02-12 16:53 ` Matthew Wilcox
@ 2006-02-12 18:47 ` Thomas Maguin
[not found] ` <200602121835.44430.T.Maguin@web.de>
2006-02-12 19:36 ` Matthias Andree
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Maguin @ 2006-02-12 18:47 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]
This patch allows to normal users on Plextor drives:
- Hide CD-R
- SingleSession
- SpeedRead
- PowerRec
- VariRec
- GigaRec
Can be tested with new qpxtool (testing version available here):
http://de.geocities.com/linux_piewie/download/qpxtool-testing.tgz
--- linux/include/scsi/old-scsi.h 2006-02-12 16:15:40.000000000 +0100
+++ linux/include/scsi/scsi.h 2006-02-12 17:23:20.000000000 +0100
@@ -108,7 +108,11 @@
#define SEARCH_LOW_12 0xb2
#define READ_ELEMENT_STATUS 0xb8
#define SEND_VOLUME_TAG 0xb6
+#define PLEXTOR_MODE 0xe9
#define WRITE_LONG_2 0xea
+#define PLEXTOR_PREC_SPEEDS 0xeb
+#define PLEXTOR_MODE2 0xed
+
#define READ_16 0x88
#define WRITE_16 0x8a
#define VERIFY_16 0x8f
--- linux/drivers/block/old-scsi_ioctl.c 2006-02-12 16:23:37.000000000
+0100
+++ linux/drivers/block/scsi_ioctl.c 2006-02-12 16:25:31.000000000 +0100
@@ -159,7 +159,10 @@
safe_for_read(GPCMD_GET_PERFORMANCE),
safe_for_read(GPCMD_SEEK),
safe_for_read(GPCMD_STOP_PLAY_SCAN),
-
+ safe_for_read(PLEXTOR_MODE),
+ safe_for_read(PLEXTOR_PREC_SPEEDS),
+ safe_for_read(PLEXTOR_MODE2),
+
/* Basic writing commands */
safe_for_write(WRITE_6),
safe_for_write(WRITE_10),
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Plextor PowerRec for users
[not found] ` <200602121835.44430.T.Maguin@web.de>
@ 2006-02-12 19:10 ` Matthew Wilcox
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-02-12 19:10 UTC (permalink / raw)
To: Thomas Maguin; +Cc: linux-scsi
On Sun, Feb 12, 2006 at 06:35:24PM +0100, Thomas Maguin wrote:
> On Sunday 12 February 2006 17:53, you wrote:
> > The trouble is that these are vendor-specific commands. So they're safe
> > *for plextor devices*, but they may well be unsafe for other vendors.
> >
> These are just read commands. A correct firmware should just reject the
> commands.
I don't think you understand the point. A non-Plextor device could have
a HALT AND CATCH FIRE command on that opcode. That definitely wouldn't
be safe. If 'just a read command' were enough, we wouldn't need to
have filtering for read commands at all.
> Plextor users have been waiting a long time for the features in linux, so
> please think about a solution which is a solution for all users.
The only solutions I can think of are big and ugly if they're in
the kernel. Why not write a set-uid helper that checks the device
manufacturer and device type, then issues the appropriate command?
That would work on 2.4 as well as 2.6.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Plextor PowerRec for users
2006-02-12 16:53 ` Matthew Wilcox
2006-02-12 18:47 ` Thomas Maguin
[not found] ` <200602121835.44430.T.Maguin@web.de>
@ 2006-02-12 19:36 ` Matthias Andree
2 siblings, 0 replies; 6+ messages in thread
From: Matthias Andree @ 2006-02-12 19:36 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Thomas Maguin, linux-scsi
Matthew Wilcox <matthew@wil.cx> writes:
> On Sun, Feb 12, 2006 at 05:18:04PM +0100, Thomas Maguin wrote:
>> Blame on me, a typo in the addresses. Changes should be this:
>> (patch is on the way)
>>
>> /usr/src/linux/include/scsi/scsi.h
>> +#define PLEXTOR_MODE ?? ?? ?? ?? ?? ?? ?? ?? ??0xe9
>> +#define PLEXTOR_PREC_SPEEDS ?? 0xeB
>> +#define PLEXTOR_MODE2 ?? ?? ?? ?? ?? ?? ?? ??0xeD
>>
>> /usr/src/linux/block/scsi/scsi_ioctl.c
>> +safe_for_read(PLEXTOR_MODE)
>> +safe_for_read(PLEXTOR_PREC_SPEEDS)
>> +safe_for_read(PLEXTOR_MODE2)
>
> The trouble is that these are vendor-specific commands. So they're safe
> *for plextor devices*, but they may well be unsafe for other vendors.
> Given the LG CD-ROM snafu [1], I'd expect people to err on the side
> of caution. Sorry.
The LG disaster is unrelated, they overloaded a *standard* command for
their own purposes. Outright stupid, but that's LG's problem, not
Linux's.
This is about vendor-specified opcodes being whitelisted. I, too,
consider this dangerous, unless someone desires to implement two tables
in the kernel:
Table 1 maps drive/model/firmware pairs to a command set table (table 2)
-- this is for compression, as many drive/model/firmware patterns can
share the same command whitelist
Table 2 implements the actual whitelists.
And if someone is going this way, perhaps the kernel should only have
the mechanism and receive the tables at boot-time from a user space
process (hotplug or whatever) so it doesn't need to keep a gazillion of
tables in core for drives the user will never have.
--
Matthias Andree
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-12 19:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12 16:18 Plextor PowerRec for users Thomas Maguin
2006-02-12 16:53 ` Matthew Wilcox
2006-02-12 18:47 ` Thomas Maguin
[not found] ` <200602121835.44430.T.Maguin@web.de>
2006-02-12 19:10 ` Matthew Wilcox
2006-02-12 19:36 ` Matthias Andree
-- strict thread matches above, loose matches on Subject: below --
2006-02-12 15:13 Thomas Maguin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.