Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efivars: Add module parameter to disable use as a pstore backend

We know that with some firmware implementations writing too much data to
UEFI variables can lead to bricking machines. Recent changes attempt to
address this issue, but for some it may still be prudent to avoid
writing large amounts of data until the solution has been proven on a
wide variety of hardware.

Crash dumps or other data from pstore can potentially be a large data
source. Add a pstore_module parameter to efivars to allow disabling its
use as a backend for pstore. Also add a config option,
CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE, to allow setting the default
value of this paramter to true (i.e. disabled by default).

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>

authored by

Seth Forshee and committed by
Matt Fleming
ec0971ba ed9dc8ce

+16 -1
+9
drivers/firmware/Kconfig
··· 62 62 will allow writing console messages, crash dumps, or anything 63 63 else supported by pstore to EFI variables. 64 64 65 + config EFI_VARS_PSTORE_DEFAULT_DISABLE 66 + bool "Disable using efivars as a pstore backend by default" 67 + depends on EFI_VARS_PSTORE 68 + default n 69 + help 70 + Saying Y here will disable the use of efivars as a storage 71 + backend for pstore by default. This setting can be overridden 72 + using the efivars module's pstore_disable parameter. 73 + 65 74 config EFI_PCDP 66 75 bool "Console device selection via EFI PCDP or HCDP table" 67 76 depends on ACPI && EFI && IA64
+7 -1
drivers/firmware/efivars.c
··· 103 103 */ 104 104 #define GUID_LEN 36 105 105 106 + static bool efivars_pstore_disable = 107 + IS_ENABLED(EFI_VARS_PSTORE_DEFAULT_DISABLE); 108 + 109 + module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644); 110 + 106 111 /* 107 112 * The maximum size of VariableName + Data = 1024 108 113 * Therefore, it's reasonable to save that much ··· 2014 2009 if (error) 2015 2010 unregister_efivars(efivars); 2016 2011 2017 - efivar_pstore_register(efivars); 2012 + if (!efivars_pstore_disable) 2013 + efivar_pstore_register(efivars); 2018 2014 2019 2015 register_filesystem(&efivarfs_type); 2020 2016