Skip to contentSkip to conversation

efi: vars: allow passing fmode= and dmode= when mounting

PATCH New Jason A. Donenfeld 1 participant 1 message Nov 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: vars: allow passing fmode= and dmode= when mounting

The default wide-open permissions of efivarfs make the prospect of storing secrets there a bit sketchy. Currently systemd does this, and then pid 1 takes care of chmodding particular nodes. But this is limited and error-prone. Rather, allow passing an explicit dmode for directories and fmode for files.

---
 fs/efivarfs/internal.h |  5 ++++
 fs/efivarfs/super.c    | 60 ++++++++++++++++++++++++++++++++++++++----
 2 files changed, 60 insertions(+), 5 deletions(-)
fs/efivarfs/internal.h +5 -0
index 8ebf3a6a8aa2..ea1ca322d247 100644
@@ -24,6 +24,11 @@ struct efivar_entry {
 	struct kobject kobj;
 };
 
+struct efivarfs_sb_info {
+	umode_t dmode;
+	umode_t fmode;
+};
+
 int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
 		void *data, bool duplicates, struct list_head *head);
 
fs/efivarfs/super.c +55 -5

109 lines not on this page · raw message

Signature · 1 line
2.38.1