Blob Blame History Raw
From: Thomas Renninger <trenn@suse.de>
Subject: Disable efi pstore by default
References: bnc#804482
Patch-Mainline: no, probably never in this form

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(+)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index d468eec9b8a6..ff500e39a95d 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -669,6 +669,13 @@ int pstore_register(struct pstore_info *psi)
 {
 	struct module *owner = psi->owner;
 
+	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;
-- 
2.13.0