Blob Blame History Raw
From: Thomas Renninger <trenn@suse.de>
Subject: Disable efi pstore by default
References: bnc#804482
Patch-Mainline: Never, considered obsolete, dropped in master

On broken BIOSes the memory area which pstore (and others) use for storing
non volatile data may not be correctly passed to the OS.
Writing data to this memory area could severely harm the system.
While the memory area can be used by other efi based instances, pstore
would heavily write data to it, increasing the risk of damage a lot.

Signed-off-by: Thomas Renninger <trenn@suse.de>
---
 fs/pstore/platform.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -560,6 +560,13 @@ out:
  */
 int pstore_register(struct pstore_info *psi)
 {
+	if (!backend && !strcmp(psi->name, "efi")) {
+		pr_info("Efi pstore disabled, enforce via pstore.backend=efi");
+		pr_info("On a broken BIOS, this can severely harm your system");
+		pr_info("Only enable efi based pstore when you know what you are doing");
+		return -EINVAL;
+	}
+
 	if (backend && strcmp(backend, psi->name)) {
 		pr_warn("ignoring unexpected backend '%s'\n", psi->name);
 		return -EPERM;