The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kenny MacDermid <kenny.macdermid@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: WD My Passport SCSI commands, kernel driver?
Date: Tue, 23 Apr 2013 17:54:13 -0400	[thread overview]
Message-ID: <20130423215413.GB14277@rm-rf.ca> (raw)

WD My Passport harddrives contain hardware encryption. An
unlock utility is provided for other OSes, but not for Linux.
I'd like to know if the kernel is the correct place for code
to unlock this device, and any tips on how it should be
implemented. I've reverse engineered the vendor specific
commands needed to unlock the device.

When connecting a locked drive the following is shown:

[] usb 1-1: new full-speed USB device number 2 using ohci_hcd
[] usb 1-1: New USB device found, idVendor=1058, idProduct=0748
[] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[] usb 1-1: Product: My Passport 0748
[] usb 1-1: Manufacturer: Western Digital
[] usb 1-1: SerialNumber: ________________________
[] Initializing USB Mass Storage driver...
[] scsi3 : usb-storage 1-1:1.0
[] usbcore: registered new interface driver usb-storage
[] USB Mass Storage support registered.
[] scsi 3:0:0:0: Direct-Access     WD       My Passport 0748 1019 PQ: 0 ANSI: 6
[] scsi 3:0:0:1: CD-ROM            WD       Virtual CD 0748  1019 PQ: 0 ANSI: 6
[] scsi 3:0:0:2: Enclosure         WD       SES Device       1019 PQ: 0 ANSI: 6
[] sd 3:0:0:0: Attached scsi generic sg3 type 0
[] sr2: scsi3-mmc drive: 51x/51x caddy
[] sr 3:0:0:1: Attached scsi CD-ROM sr2
[] sr 3:0:0:1: Attached scsi generic sg4 type 5
[] scsi 3:0:0:2: Attached scsi generic sg5 type 13
[] sd 3:0:0:0: [sdb] Unit Not Ready
[] sd 3:0:0:0: [sdb]  Sense Key : Data Protect [current]
[] sd 3:0:0:0: [sdb]  Add. Sense: Logical unit access not authorized
[] sd 3:0:0:0: [sdb] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
[] sd 3:0:0:0: [sdb] Write Protect is off
[] sd 3:0:0:0: [sdb] Mode Sense: 47 00 10 08
[] sd 3:0:0:0: [sdb] No Caching mode page present
[] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[] sd 3:0:0:0: [sdb] Unit Not Ready
[] sd 3:0:0:0: [sdb]  Sense Key : Data Protect [current]
[] sd 3:0:0:0: [sdb]  Add. Sense: Logical unit access not authorized
[] sd 3:0:0:0: [sdb] No Caching mode page present
[] sd 3:0:0:0: [sdb] Assuming drive cache: write through

Followed by 160 read errors:

[] sd 3:0:0:0: [sdb] Unhandled sense code
[] sd 3:0:0:0: [sdb]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE
[] sd 3:0:0:0: [sdb]  Sense Key : Data Protect [current]
[] sd 3:0:0:0: [sdb]  Add. Sense: Logical unit access not authorized
[] sd 3:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00
[] end_request: critical target error, dev sdb, sector 0
[] Buffer I/O error on device sdb, logical block 0

After sending the correct command to the device using sg_raw,
including a hash of the password, the device will unlock and
sdb will be readable.

Is this something suited to the kernel, or better as a
standalone utility? And if it's suited for the kernel are there
any examples of other drives requiring unlock commands?

Thank you,

Kenny

             reply	other threads:[~2013-04-23 22:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 21:54 Kenny MacDermid [this message]
2013-04-24  1:12 ` WD My Passport SCSI commands, kernel driver? Daniel Taylor

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=20130423215413.GB14277@rm-rf.ca \
    --to=kenny.macdermid@gmail.com \
    --cc=linux-kernel@vger.kernel.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