grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Jon McCune <jonmccune@google.com>
To: grub-devel@gnu.org
Cc: Jon McCune <jonmccune@google.com>
Subject: [PATCH v2 3/5] save_env should work, even if check_signatures=enforce
Date: Fri,  6 Sep 2013 09:18:51 -0700	[thread overview]
Message-ID: <1378484333-13577-4-git-send-email-jonmccune@google.com> (raw)
In-Reply-To: <1378484333-13577-1-git-send-email-jonmccune@google.com>

This is accomplished by changing the call used to read the environment
block file to avoid being subject to signature checks.  The contents that
are read from the file are discarded, as the only purpose of reading the
file is to construct the blocklist to which the new environment block
will be written.  Thus, the actual contents of the file do not pose a
security risk.

Signed-off-by: Jon McCune <jonmccune@google.com>
---
 grub-core/commands/loadenv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/commands/loadenv.c b/grub-core/commands/loadenv.c
index 49e8004..efecf6f 100644
--- a/grub-core/commands/loadenv.c
+++ b/grub-core/commands/loadenv.c
@@ -406,7 +406,7 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args)
   if (!argc)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "no variable is specified");
 
-  file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
+  file = open_envblk_file_untrusted ((state[0].set) ? state[0].arg : 0);
   if (!file)
     return grub_errno;
 
-- 
1.8.4



  parent reply	other threads:[~2013-09-06 16:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 16:18 [PATCH v2 0/5] Enable savedefault, etc with check_signatures=enforce Jon McCune
2013-09-06 16:18 ` [PATCH v2 1/5] style: indent --no-tabs --gnu-style grub-core/commands/loadenv.c Jon McCune
2013-09-06 16:18 ` [PATCH v2 2/5] load_env support for whitelisting which variables are read from an env file, even if check_signatures=enforce Jon McCune
2013-09-06 19:48   ` Andrey Borzenkov
2013-09-06 21:10     ` Jonathan McCune
2013-09-07  9:33       ` Andrey Borzenkov
2013-09-09 15:34         ` Jonathan McCune
2013-09-19 10:12           ` Andrey Borzenkov
2013-09-19 18:18             ` Jonathan McCune
2013-09-19  7:18         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-19 10:06           ` Andrey Borzenkov
2013-09-06 16:18 ` Jon McCune [this message]
2013-09-06 16:18 ` [PATCH v2 4/5] Add -k, --pubkey=FILE support to grub-install command Jon McCune
2013-09-06 19:40   ` Andrey Borzenkov
2013-09-06 21:10     ` Jonathan McCune
2013-09-06 16:18 ` [PATCH v2 5/5] Additional security-relevant documentation Jon McCune

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=1378484333-13577-4-git-send-email-jonmccune@google.com \
    --to=jonmccune@google.com \
    --cc=grub-devel@gnu.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).