public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: John Gilmore <gnu@toad.com>
To: linux-mmc@vger.kernel.org, gnu@toad.com
Subject: Erasing an SD/MMC card from usermode?
Date: Wed, 05 Jan 2011 15:03:42 -0800	[thread overview]
Message-ID: <201101052303.p05N3gAN015791@new.toad.com> (raw)

I'm working on secure deletion of data on various media.  I recalled
that the MMC and SD card specs contain a low-level command for erasing
blocks, which could be used to erase a whole card if desired.  And later
MMC specs provide a secure block erase command that also erases ancillary
unaddressable garbage blocks, etc.

However, after a perusal of the relevant kernel code (as of the 2.6.35
shipped by Ubuntu), I see no support for invoking these commands from a
user program.  I saw some patches on the LKML from Adrian Hunter in
June 2010 that added support for ioctl(BLKSECDISCARD).  Are these in
an upcoming mainline kernel?  Has someone provided a clean userspace
way to invoke it on an entire SD card or MMC card?

(On ATA disks, access to the SECURITY ERASE command is via the hdparm user
program, which invokes the SG_IO (SCSI Generic) driver.  But SECURITY ERASE
has odd edges, e.g. it requires that you set and then supply a password.  It
would be a shame if higher level programs, e.g. the Linux installer, had
to run different "secure erase" commands depending on what medium is being
erased.)

	John Gilmore

PS:  Does anyone know a way to do secure erase via a USB Mass Storage adapter?

             reply	other threads:[~2011-01-05 23:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 23:03 John Gilmore [this message]
2011-01-06  4:48 ` Erasing an SD/MMC card from usermode? Chris Ball

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=201101052303.p05N3gAN015791@new.toad.com \
    --to=gnu@toad.com \
    --cc=linux-mmc@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