diff options
author | Masahisa Kojima <masahisa.kojima@linaro.org> | 2023-11-07 14:40:55 +0900 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2023-12-11 11:19:18 +0100 |
commit | 94f7f6182c72ba642c1f20111681f9cc8621c95f (patch) | |
tree | a469f9da0e5bdfd8416b779c7d908a7ee9fc1e5e /drivers/firmware/efi/efi.c | |
parent | c44b6be62e8dd4ee0a308c36a70620613e6fc55f (diff) | |
download | linux-stable-94f7f6182c72ba642c1f20111681f9cc8621c95f.tar.gz linux-stable-94f7f6182c72ba642c1f20111681f9cc8621c95f.tar.bz2 linux-stable-94f7f6182c72ba642c1f20111681f9cc8621c95f.zip |
efivarfs: automatically update super block flag
efivar operation is updated when the tee_stmm_efi module is probed.
tee_stmm_efi module supports SetVariable runtime service, but user needs
to manually remount the efivarfs as RW to enable the write access if the
previous efivar operation does not support SetVariable and efivarfs is
mounted as read-only.
This commit notifies the update of efivar operation to efivarfs
subsystem, then drops SB_RDONLY flag if the efivar operation supports
SetVariable.
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
[ardb: use per-superblock instance of the notifier block]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/efi.c')
-rw-r--r-- | drivers/firmware/efi/efi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 32a67c61c3b8..4fcda50acfa4 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -32,6 +32,7 @@ #include <linux/ucs2_string.h> #include <linux/memblock.h> #include <linux/security.h> +#include <linux/notifier.h> #include <asm/early_ioremap.h> @@ -187,6 +188,9 @@ static const struct attribute_group efi_subsys_attr_group = { .is_visible = efi_attr_is_visible, }; +struct blocking_notifier_head efivar_ops_nh; +EXPORT_SYMBOL_GPL(efivar_ops_nh); + static struct efivars generic_efivars; static struct efivar_operations generic_ops; @@ -431,6 +435,8 @@ static int __init efisubsys_init(void) platform_device_register_simple("efivars", 0, NULL, 0); } + BLOCKING_INIT_NOTIFIER_HEAD(&efivar_ops_nh); + error = sysfs_create_group(efi_kobj, &efi_subsys_attr_group); if (error) { pr_err("efi: Sysfs attribute export failed with error %d.\n", |