mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
To: Matt Fleming <matt.fleming@intel.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	linux-efi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Seth Forshee <seth.forshee@canonical.com>
Subject: [PATCH] efivarfs: loosen restriction on valid names
Date: Thu, 07 Mar 2013 16:06:38 +0100	[thread overview]
Message-ID: <5138ACFE.30701@canonical.com> (raw)

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;
 
 	/*


             reply	other threads:[~2013-03-07 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 15:06 Maarten Lankhorst [this message]
2013-03-07 15:09 ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5138ACFE.30701@canonical.com \
    --to=maarten.lankhorst@canonical.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=seth.forshee@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®