From: joeyli Subject: Re: [RFC PATCH 00/18 v3] Signature verification of hibernate snapshot Date: Mon, 02 Sep 2013 10:12:22 +0800 Message-ID: <1378087942.7080.75.camel__26567.499448038$1378088149$gmane$org@linux-s257.site> References: <1377169317-5959-1-git-send-email-jlee@suse.com> <87eh9dzg00.fsf@mid.deneb.enyo.de> <1377734505.19568.39.camel@linux-s257.site> <87r4d8vn71.fsf@mid.deneb.enyo.de> <20130901160429.GA1375@srcf.ucam.org> <87vc2ksdfa.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Matthew Garrett , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-pm@vger.kernel.org, linux-crypto@vger.kernel.org, opensuse-kernel@opensuse.org, David Howells , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina@suse.com, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal To: Florian Weimer Return-path: Received: from smtp.nue.novell.com ([195.135.221.5]:54387 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753572Ab3IBCPP (ORCPT ); Sun, 1 Sep 2013 22:15:15 -0400 In-Reply-To: <87vc2ksdfa.fsf@mid.deneb.enyo.de> Sender: linux-crypto-owner@vger.kernel.org List-ID: =E6=96=BC =E6=97=A5=EF=BC=8C2013-09-01 =E6=96=BC 18:40 +0200=EF=BC=8CFl= orian Weimer =E6=8F=90=E5=88=B0=EF=BC=9A > * Matthew Garrett: >=20 > > On Sun, Sep 01, 2013 at 12:41:22PM +0200, Florian Weimer wrote: > > > >> But if you don't generate fresh keys on every boot, the persistent > >> keys are mor exposed to other UEFI applications. Correct me if I'= m > >> wrong, but I don't think UEFI variables are segregated between > >> different UEFI applications, so if anyone gets a generic UEFI vari= able > >> dumper (or setter) signed by the trusted key, this cryptographic > >> validation of hibernate snapshots is bypassable. > > > > If anyone can execute arbitrary code in your UEFI environment then=20 > > you've already lost. >=20 > This is not about arbitrary code execution. The problematic > applications which conflict with this proposed functionality are not > necessarily malicious by themselves and even potentially useful. >=20 > For example, if you want to provision a bunch of machines and you hav= e > to set certain UEFI variables, it might be helpful to do so in an > unattended fashion, just by booting from a USB stick with a suitable > UEFI application. Is this evil? I don't think so. > -- Yes, if there have the kind of UEFI tools like you said, and it leak to attacker, then we lost. Even we re-generate key-pair for every S4, the tool, if it can set variable, means it can replace the public key that was stored by efi bootloader in bootservices variable. Then we still lost. When the tool can only dump variable but not set, then re-generate key-pair to every S4 can prevent it. If the tool can also set variable, then I don't think there have any way to protect key-pair in UEFI variables. Using TPM is a way to protect key-pair, but user need key-in password when generate and use key to sign stuff. It noises to user, but the bes= t way to keep the password is in brain. Thanks a lot! Joey Lee