Skip to contentSkip to conversation

acpi/nfit: ensure that intel passphrase length is not larger than nvdimm

PATCH New Li RongQing 1 participant 1 message Apr 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/nfit: ensure that intel passphrase length is not larger than nvdimm

Both are same now, but if length of nvdimm passphrase is changed to less than intel passphrase length, OOB access will happen

---
 drivers/acpi/nfit/intel.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/nfit/intel.c +2 -0
index f70de71f79d6..9517fb0fd8b9 100644
@@ -248,6 +248,8 @@ static int __maybe_unused intel_security_erase(struct nvdimm *nvdimm,
 		},
 	};
 
+	BUILD_BUG_ON(NVDIMM_PASSPHRASE_LEN < ND_INTEL_PASSPHRASE_SIZE);
+
 	if (!test_bit(cmd, &nfit_mem->dsm_mask))
 		return -ENOTTY;
 
Signature · 6 lines
2.16.2

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm