Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VOeQF-0002tR-NM for mharc-grub-devel@gnu.org; Tue, 24 Sep 2013 22:01:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOeQD-0002qa-BJ for grub-devel@gnu.org; Tue, 24 Sep 2013 22:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOeQC-0001Zu-4T for grub-devel@gnu.org; Tue, 24 Sep 2013 22:01:45 -0400 Received: from mail-qe0-x249.google.com ([2607:f8b0:400d:c02::249]:58297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOeQB-0001Ze-Tp for grub-devel@gnu.org; Tue, 24 Sep 2013 22:01:44 -0400 Received: by mail-qe0-f73.google.com with SMTP id 6so625295qea.0 for ; Tue, 24 Sep 2013 19:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DF4uLKIrlpbC01sVJEJuCuK6CCnmHb1GqVVWh13kc90=; b=TNPTD82kL10h9wkUcjd3oBdGXkd8BVwum1WKdVDS1lQKaxOVwk5duW2HvR5DZA4pE+ 9LJ1VsP9Sq0VC6483rvTtIj/kLkXvGXscQx2RNHe9vdHvQYBH5zhVFrGy7E/oX2jDhK8 FYvzJ9kTTcR8sFWCjSNzYcjJ7L/8nK/vxFkqoGAKXjoo4YqOebYEksl3QdXilB2wYtq7 4HPyZJ7WPWh72Ukqpkwy3eYza7seNgs1wtiDQFwF0fJmgv7fQ4W2RQyEveDlu5rnal26 FJCyzwhUdJKV+wgJSmVqDGPeTKIdQjehyBSo+hpomhY4ccb8cyp+F+Fhrv/W9g0YcLMV q9cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DF4uLKIrlpbC01sVJEJuCuK6CCnmHb1GqVVWh13kc90=; b=k85ZC7JQWyihxAkHpGYRa4p1kBmV6O5zZOF5vbgO1ESwXe5h03coW7VRDREvAqO3m0 QV3AqErA+vqQinGzGx2tsoCs2Vk7Bi/EkFDDxPgbkqrLRkyLh8euCqg6a6wKklOPTpKd Uus+o1AZWkdkWiCUi7NE5/V4ThR8BqKmQ/WRwr93FysypAsIIAMP6m/MIAfK6SMVZ0wi 9Ga3mg6cZkve6Vj09/Oo0GsRXZWPrWJrhBpnmdKe5/dfXtmLIyOUTpaEakOtHHzV0wGB hkgEjdcNCjODDOz0j694AaRePKXJmp5tKGinVSBr0D8vd+0ReJ3cTpYFsD1t9wZxMxvB yO7w== X-Gm-Message-State: ALoCoQkk0ERUJ10ZOEsmffwOXua83SVSxae3A/7aNw7ovQa2r1czvExS1e6Q8FM3wva7uuBREGeAe9xl66A0tmVISuM3cB/Rf/pozORELxiKfxn4OXGPqOC6lLM0MBa1a8xlI8j+8j8RCGqWFREn4Hdpe6f/fN6NcEZhUGwe/h6C9sy1hcUj6y0asiDpZUwHwIcu8KxpLPowmk5d9VR6ulQN3vBdGNfHiJNJzeJAP6EBF62MvZ1fEY0= X-Received: by 10.236.36.39 with SMTP id v27mr10481555yha.5.1380074503469; Tue, 24 Sep 2013 19:01:43 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id a49si5007773yhc.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 24 Sep 2013 19:01:43 -0700 (PDT) Received: from yinz.mtv.corp.google.com (yinz.mtv.corp.google.com [172.17.81.122]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 4F65031C1F8; Tue, 24 Sep 2013 19:01:43 -0700 (PDT) Received: by yinz.mtv.corp.google.com (Postfix, from userid 184367) id 0F7F3C3E8E; Tue, 24 Sep 2013 19:01:43 -0700 (PDT) From: Jon McCune To: grub-devel@gnu.org Subject: [PATCH v4 3/4] save_env should work, even if check_signatures=enforce Date: Tue, 24 Sep 2013 19:00:31 -0700 Message-Id: <1380074432-27299-4-git-send-email-jonmccune@google.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1380074432-27299-1-git-send-email-jonmccune@google.com> References: <1380074432-27299-1-git-send-email-jonmccune@google.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c02::249 Cc: Jon McCune X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2013 02:01:46 -0000 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 --- 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 16aafbf..05157df 100644 --- a/grub-core/commands/loadenv.c +++ b/grub-core/commands/loadenv.c @@ -372,7 +372,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