Skip to content

Commit ec0971b

Browse files
Seth ForsheeMatt Fleming
Seth Forshee
authored and
Matt Fleming
committed
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 <[email protected]> Cc: Josh Boyer <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Seiji Aguchi <[email protected]> Cc: Tony Luck <[email protected]> Cc: <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
1 parent ed9dc8c commit ec0971b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

drivers/firmware/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ config EFI_VARS_PSTORE
6262
will allow writing console messages, crash dumps, or anything
6363
else supported by pstore to EFI variables.
6464

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+
6574
config EFI_PCDP
6675
bool "Console device selection via EFI PCDP or HCDP table"
6776
depends on ACPI && EFI && IA64

drivers/firmware/efivars.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ MODULE_VERSION(EFIVARS_VERSION);
103103
*/
104104
#define GUID_LEN 36
105105

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+
106111
/*
107112
* The maximum size of VariableName + Data = 1024
108113
* Therefore, it's reasonable to save that much
@@ -2009,7 +2014,8 @@ int register_efivars(struct efivars *efivars,
20092014
if (error)
20102015
unregister_efivars(efivars);
20112016

2012-
efivar_pstore_register(efivars);
2017+
if (!efivars_pstore_disable)
2018+
efivar_pstore_register(efivars);
20132019

20142020
register_filesystem(&efivarfs_type);
20152021

0 commit comments

Comments
 (0)