Skip to contentSkip to conversation

efivarfs: loosen restriction on valid names

PATCH In review Maarten Lankhorst 2 participants 2 messages Mar 7, 2013 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efivarfs: loosen restriction on valid names

Commit da27a2438 (efivarfs: guid part of filenames are case-insensitive) fails to boot, because the kernel creates files in the form of dump-type-x-y-z-GUID. Since the kernel already created files in this form, these type of files obviously exist, so the right course of action is to relax the restriction in efivarfs_valid_name.

---

drivers/firmware/efivars.c +2 -2
index 8bcb595..3ee1882 100644
@@ -921,8 +921,8 @@ static bool efivarfs_valid_name(const char *str, int len)
 	if (len < GUID_LEN + 2)
 		return false;
 
-	/* GUID should be right after the first '-' */
-	if (s - 1 != strchr(str, '-'))
+	/* GUID should be prefixed with - */
+	if (s[-1] != '-')
 		return false;
 
 	/*
#1 lore raw
Quoted 7 lines · Maarten Lankhorst

Commit da27a2438 (efivarfs: guid part of filenames are case-insensitive) fails to boot, because the kernel creates files in the form of dump-type-x-y-z-GUID. Since the kernel already created files in this form, these type of files obviously exist, so the right course of action is to relax the restriction in efivarfs_valid_name.

http://marc.info/?l=linux-kernel&m=136266857528382&w=2