nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH 5/5] libnvdimm: address state where dimm is unlocked in preOS
Date: Fri, 12 Oct 2018 12:28:36 -0700	[thread overview]
Message-ID: <CAPcyv4gg7O1AiAhNrsOXQQynGnEZedJxP7BaELbTONQQhhK62A@mail.gmail.com> (raw)
In-Reply-To: <153936865468.55836.4349279559484495728.stgit@djiang5-desk3.ch.intel.com>

On Fri, Oct 12, 2018 at 11:24 AM Dave Jiang <dave.jiang@intel.com> wrote:
>
> When the nvdimm security state is unlocked during unlock, we skip the
> operation. In this state, we are not able to fetch a key for verification
> and at the same time the dimm is unlocked. This prevents us from doing
> any security operations. We will send the freeze security DSM to make the
> state consistent.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/nvdimm/security.c |   15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvdimm/security.c b/drivers/nvdimm/security.c
> index 7b5d7c77514d..6c5423228b31 100644
> --- a/drivers/nvdimm/security.c
> +++ b/drivers/nvdimm/security.c
> @@ -250,8 +250,19 @@ int nvdimm_security_unlock_dimm(struct nvdimm *nvdimm)
>         if (!nvdimm->security_ops)
>                 return 0;
>
> -       if (nvdimm->state == NVDIMM_SECURITY_UNLOCKED ||
> -                       nvdimm->state == NVDIMM_SECURITY_UNSUPPORTED ||
> +       /*
> +        * If the pre-OS has unlocked the DIMM, we will not be able to
> +        * verify the key against the hardware. Therefore we will not
> +        * retrieve the key and will freeze the security config. This will
> +        * prevent any other security operations.
> +        */

I think we should try to retrieve the key if the DIMM is unlocked and
verify it with a 'change-key-to-self' check. If either of those steps
fail then freeze the dimm.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2018-10-12 19:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 18:23 [PATCH 1/5] libnvdimm: fix updating of kernel key during nvdimm key update Dave Jiang
2018-10-12 18:23 ` [PATCH 2/5] libnvdimm: fix incorrect output when nvdimm disable failed Dave Jiang
2018-10-12 19:22   ` Dan Williams
2018-10-12 18:24 ` [PATCH 3/5] libnvdimm: remove driver attached check for secure erase Dave Jiang
2018-10-12 19:23   ` Dan Williams
2018-10-12 18:24 ` [PATCH 4/5] libnvdimm: remove code to pull user key when there's no kernel key Dave Jiang
2018-10-12 19:26   ` Dan Williams
2018-10-12 18:24 ` [PATCH 5/5] libnvdimm: address state where dimm is unlocked in preOS Dave Jiang
2018-10-12 19:28   ` Dan Williams [this message]
2018-10-12 19:19 ` [PATCH 1/5] libnvdimm: fix updating of kernel key during nvdimm key update Dan Williams

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=CAPcyv4gg7O1AiAhNrsOXQQynGnEZedJxP7BaELbTONQQhhK62A@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-nvdimm@lists.01.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;
as well as URLs for NNTP newsgroup(s).