Skip to content

Commit bb7bf69

Browse files
committed
nvdimm: Allow overwrite in the presence of disabled dimms
It is not clear why the original implementation of overwrite support required the dimm driver to be active before overwrite could proceed. In fact that can lead to cases where the kernel retains an invalid cached copy of the labels from before the overwrite. Unfortunately the kernel has not only allowed that case, but enforced it. Going forward, allow for overwrite to happen while the label area is offline, and follow-on with updates to 'ndctl sanitize-dimm --overwrite' to trigger the label area invalidation by default. Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Ira Weiny <ira.weiny@intel.com> Cc: Jeff Moyer <jmoyer@redhat.com> Reported-by: Krzysztof Kensicki <krzysztof.kensicki@intel.com> Fixes: 7d98809 ("acpi/nfit, libnvdimm/security: Add security DSM overwrite support") Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent dbbf168 commit bb7bf69

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

drivers/nvdimm/security.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,6 @@ static int security_overwrite(struct nvdimm *nvdimm, unsigned int keyid)
379379
|| !nvdimm->sec.flags)
380380
return -EOPNOTSUPP;
381381

382-
if (dev->driver == NULL) {
383-
dev_dbg(dev, "Unable to overwrite while DIMM active.\n");
384-
return -EINVAL;
385-
}
386-
387382
rc = check_security_state(nvdimm);
388383
if (rc)
389384
return rc;

0 commit comments

Comments
 (0)