linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
To: shea-yfkUTty7RcRWk0Htik3J/w@public.gmane.org
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>,
	Jeremy Kerr <jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	"mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org"
	<mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: efivarfs: Bad directory entry when variable has / in name
Date: Wed, 20 Mar 2013 08:41:17 +0000	[thread overview]
Message-ID: <5149762D.6080907@console-pimps.org> (raw)
In-Reply-To: <4764b7f1f5e6d79938d476ea68b99199-yfkUTty7RcRWk0Htik3J/w@public.gmane.org>

On 03/19/2013 08:36 PM, shea-yfkUTty7RcRWk0Htik3J/w@public.gmane.org wrote:
> Hello,
> 
> When there is an EFI variable with a forward slash in its name, 
> /sys/firmware/efi/efivars contains a directory entry with a forward 
> slash, which of course causes all sorts of problems (e.g. EINVAL from 
> stat(2)). Off the top of my head, I can think of two ways to handle 
> this:
> 
> 1. Simply skip such variables when making the sysfs entries
> 2. Come up with an escaping scheme, e.g. "a single backslash is 
> actually a forward slash, two backslashes are actually a single 
> backslash" or some such.
> 
> Thoughts?

Right. Have you seen machines with such variable names in the wild?
There's nothing in the specification that prohibits the use of slashes
in variable names, so I'm not in favour of option 1 above and mangling
the variable name would likely cause too much confusion.

The best solution I can come up with is to create directories for any
variable names that contain "/" (which would also make it possible to
build filesystem hierarchies with EFI variables). The user could choose
to ignore the actual layout of the filesystem since opening the variable
"adirectory/file" with,

	open("adirectory/file-<guid>");

would work without it being necessary for the user to handle slashes in
variable names.

What do you think?

Presumably this is also an issue with the old EFI vars sysfs code?

-- 
Matt Fleming, Intel Open Source Technology Center

  parent reply	other threads:[~2013-03-20  8:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 20:36 efivarfs: Bad directory entry when variable has / in name shea-yfkUTty7RcRWk0Htik3J/w
     [not found] ` <4764b7f1f5e6d79938d476ea68b99199-yfkUTty7RcRWk0Htik3J/w@public.gmane.org>
2013-03-20  8:41   ` Matt Fleming [this message]
     [not found]     ` <5149762D.6080907-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-03-20 17:02       ` shea-yfkUTty7RcRWk0Htik3J/w

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=5149762D.6080907@console-pimps.org \
    --to=matt-hnk1s37rvnbexh+ff434mdi2o/jbrioy@public.gmane.org \
    --cc=jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
    --cc=shea-yfkUTty7RcRWk0Htik3J/w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).