lkml.org 
[lkml]   [2019]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: nvdimm crash at boot
On Tue, Jan 8, 2019 at 3:34 PM Kees Cook <keescook@chromium.org> wrote:
>
> On Tue, Jan 8, 2019 at 3:28 PM Dan Williams <dan.j.williams@intel.com> wrote:
> > Ah, thanks for the report! The key difference is that you don't define
> > a "label area", so the driver bails out early and never initializes
> > the security state.
> >
> > This should fix it up.
> >
> > diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
> > index 4890310df874..636cdb06ee17 100644
> > --- a/drivers/nvdimm/dimm_devs.c
> > +++ b/drivers/nvdimm/dimm_devs.c
> > @@ -514,7 +514,7 @@ static umode_t nvdimm_visible(struct kobject
> > *kobj, struct attribute *a, int n)
> >
> > if (a != &dev_attr_security.attr)
> > return a->mode;
> > - if (nvdimm->sec.state < 0)
> > + if (!nvdimm->sec.ops || nvdimm->sec.state < 0)
> > return 0;
> > /* Are there any state mutation ops? */
> > if (nvdimm->sec.ops->freeze || nvdimm->sec.ops->disable
>
> Okay, cool. I wasn't sure if that test needed a deeper check. :)
>
> Fixes: 37833fb7989a9 ("acpi/nfit, libnvdimm: Add freeze security
> support to Intel nvdimm")
> Tested-by: Kees Cook <keescook@chromium.org>
>

Actually, looking closer this should have been avoided by the fact
that __nvdimm_create() initializes the security state early and that
nvdimm->sec.state should have saved us.

I'll dig a bit deeper with your qemu config.

\
 
 \ /
  Last update: 2019-01-09 00:54    [W:0.429 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site