]> git.baikalelectronics.ru Git - kernel.git/commit
libnvdimm/security: Tighten scope of nvdimm->busy vs security operations
authorDan Williams <dan.j.williams@intel.com>
Tue, 27 Aug 2019 00:55:00 +0000 (17:55 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 29 Aug 2019 20:51:57 +0000 (13:51 -0700)
commit95b119086c1b4d22516e572b378eb154c6464f2e
tree45cdf145a18f3ecae8c06ee1f78c53f0359fb07c
parent9e9afa209cd5b1200c9742d89176f1c6ee606962
libnvdimm/security: Tighten scope of nvdimm->busy vs security operations

An attempt to freeze DIMMs currently runs afoul of default blocking of
all security operations in the entry to the 'store' routine for the
'security' sysfs attribute.

The blanket blocking of all security operations while the DIMM is in
active use in a region is too restrictive. The only security operations
that need to be aware of the ->busy state are those that mutate the
state of data, i.e. erase and overwrite.

Refactor the ->busy checks to be applied at the entry common entry point
in __security_store() rather than each of the helper routines to enable
freeze to be run regardless of busy state.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/156686729996.184120.3458026302402493937.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/dimm_devs.c
drivers/nvdimm/security.c