From: Christian Loehle <christian.loehle@arm.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Daniel Kucera <linux-mmc@danman.eu>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH v4] mmc: core: allow detection of locked cards
Date: Thu, 20 Jun 2024 16:31:03 +0100 [thread overview]
Message-ID: <cf863ebd-df9c-4088-a273-26408c7c132a@arm.com> (raw)
In-Reply-To: <CAPDyKFpLkmU-vjAaM=QDkc+3F3tMNjViOdnYSFNqyDduyfBm1g@mail.gmail.com>
On 6/20/24 15:32, Ulf Hansson wrote:
> On Thu, 20 Jun 2024 at 14:59, Daniel Kucera <linux-mmc@danman.eu> wrote:
>>
>> On 2024-06-20 14:38, Ulf Hansson wrote:
>>> On Thu, 6 Jun 2024 at 15:12, <linux-mmc@danman.eu> wrote:
>>>>
>>>> From: Daniel Kucera <linux-mmc@danman.eu>
>>>>
>>>> Locked SD card will not reply to SEND_SCR or SD_STATUS commands
>>>> so it was failing to initialize previously. When skipped,
>>>> the card will get initialized and CMD42 can be sent using
>>>> ioctl to unlock the card or remove password protection.
>>>> For eMMC, this is not necessary because all initialization
>>>> commands are allowed in locked state.
>>>> Until unlocked, all read/write calls will timeout.
>>>
>>> Skipping the commands above, only means the card gets partially
>>> initialized.
>>
>> Correct, but it's an improvement in comparison to current state.
>
> Not sure I agree with that, sorry.
>
>>
>>> Leaving a card in that state seems fragile.
>>
>> Fragile in what sense? Nothing can happen to the card as it is locked.
>
> We may end up having a card half-way initialized that we can't really
> communicate with in a stable manner. From a system point of view, I
> would be worried.
>
> I would rather just power off the card if initialization fails and
> remove its corresponding device from the system.
>
>>
>>> What will
>>> happen to upper block layers and filesystems when trying to access it?
>>
>> Everything will simply time-out.
>
> Yes, but it's uncertain what that could lead to?
>
> What will happen with power consumption and power management support,
> for example.
Definitely an aspect that needs to be considered, probably even just
powering it off after 10ish seconds would be better, then you still
get the chance of unlocking it without having a locked card unknowingly
consuming power.
Having a saved key and sending that to any card being plugged in seems
wrong if you consider security, then again if you consider security
you should probably somewhere else than the SD/MMC LOCK/UNLOCK ;)
Kind Regards,
Christian
next prev parent reply other threads:[~2024-06-20 15:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 13:12 [PATCH v4] mmc: core: allow detection of locked cards linux-mmc
2024-06-20 12:38 ` Ulf Hansson
2024-06-20 12:59 ` Daniel Kucera
2024-06-20 14:32 ` Ulf Hansson
2024-06-20 15:31 ` Christian Loehle [this message]
2024-06-20 18:15 ` Daniel Kucera
2024-06-21 7:16 ` Avri Altman
2024-07-01 8:33 ` Daniel Kucera
2024-07-08 13:32 ` Ulf Hansson
2024-07-08 13:43 ` Ulf Hansson
2024-07-09 20:06 ` Avri Altman
2024-07-10 5:21 ` Daniel Kucera
2024-07-10 5:49 ` Avri Altman
2024-07-10 13:26 ` Ulf Hansson
2024-07-13 20:50 ` Daniel Kucera
2024-07-14 6:49 ` Avri Altman
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=cf863ebd-df9c-4088-a273-26408c7c132a@arm.com \
--to=christian.loehle@arm.com \
--cc=linux-mmc@danman.eu \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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