Skip to contentSkip to conversation

Plextor PowerRec for users

DISCUSSION Thomas Maguin 3 participants 5 messages Feb 12, 2006 1 message not in the archive SCSI

lore
Share & tools
lore
#0 lore raw

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)

#1 lore raw

Review

Quoted 12 lines · Thomas Maguin

Blame on me, a typo in the addresses. Changes should be this:
(patch is on the way)

/usr/src/linux/include/scsi/scsi.h

(quoted diff) +3 -0
+#define PLEXTOR_MODE ?? ?? ?? ?? ?? ?? ?? ?? ??0xe9
+#define PLEXTOR_PREC_SPEEDS ?? 0xeB
+#define PLEXTOR_MODE2 ?? ?? ?? ?? ?? ?? ?? ??0xeD

/usr/src/linux/block/scsi/scsi_ioctl.c

(quoted diff) +3 -0
+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

#2 lore raw

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

include/scsi/scsi.h   2006-02-12 17:23:20.000000000 +0100 renamed from include/scsi/old-scsi.h       2006-02-12 16:15:40.000000000 +0100 +0 -0
@@ -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),

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 6 lines · Thomas Maguin
Quoted 3 lines · you

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.

Quoted 2 lines

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.

#5 lore raw
In reply to Matthew Wilcox
Quoted 9 lines · Matthew Wilcox
Quoted 8 lines · Thomas Maguin

Blame on me, a typo in the addresses. Changes should be this:
(patch is on the way)

/usr/src/linux/include/scsi/scsi.h

(quoted diff) +3 -0
+#define PLEXTOR_MODE ?? ?? ?? ?? ?? ?? ?? ?? ??0xe9
+#define PLEXTOR_PREC_SPEEDS ?? 0xeB
+#define PLEXTOR_MODE2 ?? ?? ?? ?? ?? ?? ?? ??0xeD
Quoted 9 lines

Review

Quoted 4 lines

/usr/src/linux/block/scsi/scsi_ioctl.c

(quoted diff) +3 -0
+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.

Signature · 1 line
Matthias Andree