mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] efivarfs: loosen restriction on valid names
@ 2013-03-07 15:06 Maarten Lankhorst
  2013-03-07 15:09 ` Matt Fleming
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2013-03-07 15:06 UTC (permalink / raw)
  To: Matt Fleming; +Cc: Matthew Garrett, linux-efi, LKML, Seth Forshee

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.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: stable@vger.kernel.org [3.8]
---

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 8bcb595..3ee1882 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -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;
 
 	/*


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] efivarfs: loosen restriction on valid names
  2013-03-07 15:06 [PATCH] efivarfs: loosen restriction on valid names Maarten Lankhorst
@ 2013-03-07 15:09 ` Matt Fleming
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Fleming @ 2013-03-07 15:09 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: Matthew Garrett, linux-efi, LKML, Seth Forshee

On Thu, 2013-03-07 at 16:06 +0100, Maarten Lankhorst wrote:
> 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.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> Cc: stable@vger.kernel.org [3.8]

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-07 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 15:06 [PATCH] efivarfs: loosen restriction on valid names Maarten Lankhorst
2013-03-07 15:09 ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®