Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2781192imm; Sun, 5 Aug 2018 12:04:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdizoo7UyJfK8/oGZPsjt9UzF4cXkpjxihBatmCk3F+rT+Fi83JePHP3jDgmXDAGzCjIAIP X-Received: by 2002:a65:5c83:: with SMTP id a3-v6mr11755471pgt.164.1533495898223; Sun, 05 Aug 2018 12:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533495898; cv=none; d=google.com; s=arc-20160816; b=qSzlYWYmxfvDRUaRe9mDyvE+2ZQA1HggHrSUEz6USgLbeOhaBbQoS98VwV4UqH1ALb 3nIYuE2jdCW9x3HKxOKT2+RO+gt05buutP4ZRjFuZmJQAiWfAdc6GJmkF+pmw3DJURwQ SFiLT1Em4048+GLuLjc2PZ3U1hJdLNJMbfRTg4+dmYJf1QeN4/mCTRFmROb34Qvz1D/N 1/nSbXcLJBwOfRpBNK+yU8E/Bq5EsPFdCe5dVA/17e0iYqVrYfK0XujC3sNm7xRbJAxd 4yGiyUYe0DBosTVAcQcqNfeqj3LPLuUDcoh4MG337k/3KM1Zwvf07lAfAB03AY/upEKJ 9oZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=qix4fh1rqX3dwE3q59Q0yUZYFb9QOdrVEHW3P2Yh1fY=; b=Waxq6rGWng68I9gdNDhk+vVEDDMF+3ofbwBgHdKV94k4oLjosVrGCymFhGPcw1a/qz RbuEnqDLUfXxaoz8smc8hITSS7iU+SSNIZIPBeRQfKZHqg9pHMX+Xya5N2dmQ9zICBwy jey0aBed1VzL2YpQ2x2BFlq0Dd1xJB6nG9JB737bdwn8n0X2WX1oIH/gDncINH8SyIYL wZLd351Udau8Toi+WnLbcloPt+14zxxsj6A2seTHdOHGU/FJbwX1+NTHf50OuueRXh3O bRDqVQWbZgWklup7jZRn+ed1wgvZf1fShiw6YB8ZZzgLIhoQdLmI5b43HuulXl8eCHhl Kozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cV41tJEv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15-v6si9224093pgc.309.2018.08.05.12.04.12; Sun, 05 Aug 2018 12:04:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cV41tJEv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbeHEVFp (ORCPT + 99 others); Sun, 5 Aug 2018 17:05:45 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:34001 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbeHEVFp (ORCPT ); Sun, 5 Aug 2018 17:05:45 -0400 Received: by mail-it0-f67.google.com with SMTP id d70-v6so10356558ith.1 for ; Sun, 05 Aug 2018 12:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qix4fh1rqX3dwE3q59Q0yUZYFb9QOdrVEHW3P2Yh1fY=; b=cV41tJEvMTlvZKz5zGIa3Z1IoQD//tcZCyqQ3I57y5IdBoYkErB4DlbTvR/nQe3Kjl CJ0PBSMZfs/qngBAVB3DIeFBY6K1IMdyK5Y2GwWPNMQqvzVzTz5KgCo2YTh5YJcdl94G c6BNYKlx5L4kg1zJoT9YyMybPov9ZYAEl+m7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qix4fh1rqX3dwE3q59Q0yUZYFb9QOdrVEHW3P2Yh1fY=; b=njeGcdIX31YSn6mFXvsLjZwCbWlgFfMKhUabQ+ng+aCzEM/65Yx7RLY0xKC/V8W/Dn +xtTqHKUfNV16V2Plll0FoeK3wafIKvfK52w3zFq15XBDAIL13mMoezAYRDDMh777Md+ ugGj8KS4yRVJBwbvaDrCPXBsdHrUEo+xHZUtlU9+DYwSskJU4/GbdE6bUgPn6mWmk9wH cuyZ8sb+wolyXalEcn8onHc+38nmZHaHFfUEUWHPsAzrVkkIhiYWufNRBm+f8erzAn1k JE2fW3t1c/9ANc+ilb0sZss0whJFp6ylEYp/hc60sVHNg0+iP3Y+DLBCD56Ty1b3LsuQ cMmg== X-Gm-Message-State: AOUpUlHcOui7X00q/WjwyanhCKclxJqJ/6p5GbfjaO7n2nTaiMSvBLYd y69i8XZjTjLb6A7QVIQMuCrEpj2PmWNB35Mqp/vOoQ== X-Received: by 2002:a24:5242:: with SMTP id d63-v6mr13090461itb.138.1533495613623; Sun, 05 Aug 2018 12:00:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Sun, 5 Aug 2018 12:00:13 -0700 (PDT) In-Reply-To: <20180805163139.GB27062@linux-l9pv.suse> References: <20180805032119.20485-1-jlee@suse.com> <20180805163139.GB27062@linux-l9pv.suse> From: Ard Biesheuvel Date: Sun, 5 Aug 2018 21:00:13 +0200 Message-ID: Subject: Re: [PATCH 0/6][RFC] Add EFI secure key to key retention service To: joeyli Cc: "Lee, Chun-Yi" , Linux Kernel Mailing List , linux-efi , "the arch/x86 maintainers" , keyrings@vger.kernel.org, linux-integrity , Kees Cook , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Pavel Machek , Chen Yu , Oliver Neukum , Ryan Chen , David Howells , Mimi Zohar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5 August 2018 at 18:31, joeyli wrote: > On Sun, Aug 05, 2018 at 09:25:56AM +0200, Ard Biesheuvel wrote: >> Hello Chun,yi, >> >> On 5 August 2018 at 05:21, Lee, Chun-Yi wrote: >> > When secure boot is enabled, only signed EFI binary can access >> > EFI boot service variable before ExitBootService. Which means that >> > the EFI boot service variable is secure. >> > >> >> No it, isn't, and this is a very dangerous assumption to make. >> >> 'Secure' means different things to different people. 'Secure boot' is >> a misnomer, since it is too vague: it should be called 'authenticated >> boot', and the catch is that authentication using public-key crypto >> does not involve secrets at all. The UEFI variable store was not >> designed with confidentiality in mind, and assuming [given the >> reputation of EFI on the implementation side] that you can use it to >> keep secrets is rather unwise imho. >> > > I agreed with you. Especially I can't refute the part of EFI > implementation, manufacturers can not be fully trusted. > > I am thinking a case... Some machines provide setup mode. If user > earses all manufacturer's reloaded keys and only enrolls their own > key. Which means that user fully controls the authentication > environment. Then the EFI boot service varible can be trusted by > the user. This has nothing to do with trust but everything to do with confidentiality. *Nothing* in the UEFI variable store stack has been designed or implemented with confidentiality in mind. The contents of EFI variables are readable in the clear from the SPI flash. Code that handles variable store reads may leave unsanitized buffers behind. We have efivarfs that needs to be modified to hide 'secret' variables, but also, to kzfree() every allocation that is used in handling varstore access etc etc. > But this case is too strict for normal user. > > Thanks for your review and comments. I will think more about your > suggestions. > > Joey Lee