Skip to content

RFC Add MMC Password Protection (lock/unlock) support V7

Anderson Briglia linux-omap lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Add MMC Password Protection (lock/unlock) support V7: mmc_ignore_locked.diffdrivers/mmc/mmc.c drivers/mmc/mmc_sysfs.c include/linux/mmc/card.h+23 -01 reply
2/5Add MMC Password Protection (lock/unlock) support V7: mmc_key_retention.diffdrivers/mmc/Kconfig drivers/mmc/mmc.h drivers/mmc/mmc_sysfs.c+108 -40 replies
3/5Add MMC Password Protection (lock/unlock) support V7: mmc_lock_unlock.diffdrivers/mmc/mmc.c drivers/mmc/mmc.h include/linux/mmc/protocol.h+131 -07 replies
4/5Add MMC Password Protection (lock/unlock) support V7: mmc_sysfs.diffdrivers/mmc/mmc_sysfs.c+97 -04 replies
5/5Add MMC Password Protection (lock/unlock) support V7: mmc_omap_dma.diffdrivers/mmc/omap.c+8 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/5] [RFC] Add MMC Password Protection (lock/unlock) support V7

Hi all,

New in this version:

- Comments from Russel, Pierre and Anderson Lizardo reviewed and applied.
- MMC_CAP_LOCK_UNLOCK capability removed.
- For more information track the discussion at linux-omap mailing list.

This series of patches add support for MultiMediaCard (MMC) password protection, as described in the MMC Specification v4.1. This feature is supported by all compliant MMC cards, and used by some devices such as Symbian OS cell phones to optionally protect MMC cards with a password.

By default, a MMC card with no password assigned is always in "unlocked" state. After password assignment, in the next power cycle the card switches to a "locked" state where only the "basic" and "lock card" command classes are accepted by the card. Only after unlocking it with the correct password the card can be normally used for operations like block I/O.

Password management and caching is done through the "Kernel Key Retention Service" mechanism and the sysfs filesystem. A new sysfs attribute was added to the MMC driver for unlocking the card, assigning a password to an unlocked card, change a card's password, remove the password and check locked/unlocked status.

A sample text-mode reference UI written in shell script (using the keyctl command from the keyutils package), can be found at:

http://www.indt.org.br/10le/mmc_pwd/mmc_reference_ui-20060130.tar.bz2

TODO:

- Ongoing: Extend the MMC PWD Scheme to SD Cards.

- Password caching: when inserting a locked card, the driver should try to unlock it with the currently stored password (if any), and if it fails, revoke the key containing it and fallback to the normal "no password present" situation.

Known Issue:

- Some cards have an incorrect behaviour (hardware bug?) regarding password acceptance: if an affected card has password <pwd>, it accepts <pwd><xxx> as the correct password too, where <xxx> is any sequence of characters, of any length. In other words, on these cards only the first <password length> bytes need to match the correct password.

Comments and suggestions are always welcome.

Signature · 7 lines
Anderson Briglia,
Carlos Aguiar

Embedded Linux Lab - 10LE
Nokia Institute of Technology - INdT
Manaus - Brazil
--