diff options
author | Dave Jiang <dave.jiang@intel.com> | 2018-12-07 20:33:30 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-12-21 23:44:41 +0300 |
commit | 03b65b22ada8115a7a7bfdf0789f6a94adfd6070 (patch) | |
tree | d8ac0a260db2dcac8b52ed36566bd9b89ab2d116 /drivers/nvdimm/nd-core.h | |
parent | 4c6926a23b76ea23403976290cd45a7a143f6500 (diff) | |
download | linux-03b65b22ada8115a7a7bfdf0789f6a94adfd6070.tar.xz |
acpi/nfit, libnvdimm: Add disable passphrase support to Intel nvdimm.
Add support to disable passphrase (security) for the Intel nvdimm. The
passphrase used for disabling is pulled from an encrypted-key in the kernel
user keyring. The action is triggered by writing "disable <keyid>" to the
sysfs attribute "security".
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd-core.h')
-rw-r--r-- | drivers/nvdimm/nd-core.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h index 15eff40f55f6..d1351c0b1119 100644 --- a/drivers/nvdimm/nd-core.h +++ b/drivers/nvdimm/nd-core.h @@ -57,6 +57,15 @@ static inline enum nvdimm_security_state nvdimm_security_state( return nvdimm->sec.ops->state(nvdimm); } int nvdimm_security_freeze(struct nvdimm *nvdimm); +#if IS_ENABLED(CONFIG_NVDIMM_KEYS) +int nvdimm_security_disable(struct nvdimm *nvdimm, unsigned int keyid); +#else +static inline int nvdimm_security_disable(struct nvdimm *nvdimm, + unsigned int keyid) +{ + return -EOPNOTSUPP; +} +#endif /** * struct blk_alloc_info - tracking info for BLK dpa scanning |