Received: by 10.213.65.68 with SMTP id h4csp401082imn; Tue, 3 Apr 2018 23:58:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+W0uNlegcJ8hZBQNtgoRRDE7/xDwBK+9NKZloVzb94Er0CTT7L0eFNOqdIYzc/tR/FadKK X-Received: by 10.99.140.14 with SMTP id m14mr11485656pgd.320.1522825099020; Tue, 03 Apr 2018 23:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522825098; cv=none; d=google.com; s=arc-20160816; b=Nn2hXEPxw0wXgOK2PiEx1uAuXaf0X2uc1XESeuA4CuWZ+tuPWCDeHTuDpDpE+ivPP7 +F0W9btiDyhPCo5kFA5enDufDiH0k2Ec3efnic1C5Z+fsSmUQeYqDKtPJxsgpTr+gR63 FCl5YT8LtPymKzCzTGWQwzm9khzqXJ3kdO75z8n1OBxDf9skiVx+EQHe/mSfcu1RDcwU b1EZbBOzbGM4FAKhBcbIPGjSIlUk/7B/5mXDj3t2vP1p5a8BfhQag0sZRXNxV0wrEFcn x1gRKakCdpiuIrlhEqc50yOiUnXNN549dEFh/ICHZl8fQwySyh5TYIMMsvj6Mn7zCJog tlVQ== 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=ac6X2KLtLZeFfgYaiC+R5maslAqzfnAoT+ITBaKVMv0=; b=cI/+g8AcY6nRQ7tZYHX2h64EiRQtNH7FTTXJuIGoe3mbMdn+pUJGqCuJ0rUgCEMS54 HW8yr7KLYrgGiLa+Lrfp49lZpgGqR5Y92Y3uFujgbQIiEvC6LDRsCK8tXBEBtybmxNDK DRZ/y1Du1nhzBifRQPix6INmkxhuJcEheddBbasnDDXXR6D4Mjgs+csKFHncdIIM55F7 /ltgS3F+67d69sO2GHuEFh4DmukumjOOvLirDelzxbLUShHmhDCxrHIiCkZS7jafD/n/ LK6LfKgVfFSUjXt7evUzALy/Rlgqeqx81gsM20yjUiYy3JwSZkxarGiEsUP89wrytEX+ CmXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QeaETOrn; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si2667306plk.29.2018.04.03.23.58.04; Tue, 03 Apr 2018 23:58:18 -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=@gmail.com header.s=20161025 header.b=QeaETOrn; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbeDDG4z (ORCPT + 99 others); Wed, 4 Apr 2018 02:56:55 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41531 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbeDDG4w (ORCPT ); Wed, 4 Apr 2018 02:56:52 -0400 Received: by mail-wr0-f196.google.com with SMTP id s12so10279777wrc.8; Tue, 03 Apr 2018 23:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ac6X2KLtLZeFfgYaiC+R5maslAqzfnAoT+ITBaKVMv0=; b=QeaETOrn1ltp/qFL8HCB9w+Oo4RzQPi118I+te3FgvEDBW4JmUDGmxFF0r8D2Fq7MT a/Po+EQ+2WvlEFE7POBxQ+RA/aBnYTxjvV2mwt6oe4T5+8J/qlD62t44UaWDsnpTugDz 3DPyOXy8Y9XPLyRnlbW0iuoqN1gHAGTfIflnBMKtvO4VbfwYs+Ss0aXZDTHaOIPcVeG6 7+snv5Z4BGVH46adbaaWiUeXpOwVDM9MEySbJW8elPqh0qlOGcJzVXvC2AJPz+cA6DDG 1YFkyrce6komlPEThRaoyOZxGphazTiBBjDAVffEOxOj5zVt3dGR860YVMoTYPHbzk+w nH4Q== 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=ac6X2KLtLZeFfgYaiC+R5maslAqzfnAoT+ITBaKVMv0=; b=tVkgDtqWuwVwBRSDj5TX+VHVPJcoh1ut/4Ck7IArVQhqnPETeiVy6hBnzcE9Y+ektl 9IxWykES9Tq93vTl5ogyVnMlJHyKcXvcToF/0Od8NKoGILDsNeF5buMRQx+CKASwOVve PYP4mlLVGJ5HIzNMa8h7fQ5J386stspzDPCj/SNglnQrMZpWkaQmpseBfGTo/zHoBCzi rd838TXbiNlY1YL9gdS3rCjraNWxOrSwafk2kq7Pi0bIjwbsPF+man9pKLedkbpj6eqh Pl9eLRUG1cpeUZpnR9kytVVAaHcUTfmsb/YX0AbKJmO5IeJJsdWPD5jt/duOfRheDvFP PNjw== X-Gm-Message-State: AElRT7G3QnJFXBFqUi8WLTg0To4iygCV0Hyf93knJ9JF4dJnHDIlTDRl WYyOVYaoA94342Fmpug4RXR+VBngcWnC7fuDM+g= X-Received: by 10.223.175.99 with SMTP id z90mr12484983wrc.258.1522825010369; Tue, 03 Apr 2018 23:56:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.151.36 with HTTP; Tue, 3 Apr 2018 23:56:49 -0700 (PDT) In-Reply-To: References: <4136.1522452584@warthog.procyon.org.uk> <186aeb7e-1225-4bb8-3ff5-863a1cde86de@kernel.org> <30459.1522739219@warthog.procyon.org.uk> <9758.1522775763@warthog.procyon.org.uk> <13189.1522784944@warthog.procyon.org.uk> <9349.1522794769@warthog.procyon.org.uk> From: Peter Dolding Date: Wed, 4 Apr 2018 16:56:49 +1000 Message-ID: Subject: Re: [GIT PULL] Kernel lockdown for secure boot To: Matthew Garrett Cc: Linus Torvalds , luto@kernel.org, David Howells , Ard Biesheuvel , James Morris , Alan Cox , Greg Kroah-Hartman , Linux Kernel Mailing List , jforbes@redhat.com, linux-man@vger.kernel.org, jlee@suse.com, LSM List , linux-api@vger.kernel.org, Kees Cook , linux-efi 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 Wed, Apr 4, 2018 at 11:13 AM, Matthew Garrett wrote: > There are four cases: > > Verified Boot off, lockdown off: Status quo in distro and mainline kernels > Verified Boot off, lockdown on: Perception of security improvement that's > trivially circumvented (and so bad) > Verified Boot on, lockdown off: Perception of security improvement that's > trivially circumvented (and so bad), status quo in mainline kernels > Verified Boot on, lockdown on: Security improvement, status quo in distro > kernels > > Of these four options, only two make sense. The most common implementation > of Verified Boot on x86 platforms is UEFI Secure Boot, Stop right there. Verified boot does not have to be UEFI secureboot. You could be using a uboot verified boot or https://www.coreboot.org/git-docs/Intel/vboot.html google vboot. Neither of these provide flags to kernel to say they have been performed. So Verified boot looking off to kernel yet lockdown needing to be on is one very valid combination and must be supported because the Linux kernel does not always know when it verified boot environment. When the Linux kernel thinks verified boot is off it may not be trivial to circumvent. Now Verified Boot on, lockdown off. Insanely this can be required in diagnostic on some embedded platform because EFI secureboot does not have a off switch. These are platforms where they don't boot if they don't have a PK and KEK set installed. Yes some of these is jtag the PK and KEK set in. The fact that this Verified Boot on, lockdown off causes trouble points to a clear problem. User owns the hardware they should have the right to defeat secureboot if they wish to. In fact the issue that you can not install a KEK per operating system installed shows a problem as well. So all OS use the same KEK for their installers and then you have all non Microsoft in a lot of cases the same KEK for booting OS. Any of these bootloaders/kernels with defect will end up with the security being exactly like Verified Boot on, lockdown off. Remember attackers will send around copies of what ever they need to so they can breach a system so they find a defective solution some where they will ship it everywhere. Attackers that secureboot is attempted to prevent are criminal anyhow what is a little bit of copyright violation to them.. So when the current UEFI design is security theatre there should not be any special effort to support it. If UEFI was not security theatre there would be a clean way for people install and setup up their systems to list what operating system KEK should be accepted so allowing attack surface area to be minimised and the damaged form any flawed implementation to also be limited. This way end users could opt in or out of operating systems based on security. If user has opted out of all operating systems doing Verified Boot on, lockdown off: those are not a threat. Also any OS with defective kernel or bootloader that the system has not allowed the KEK of would also not be a threat. Really I see no reason to be bending over in the Linux kernel for UEFI secureboot. You list all 4 types need to exist for different usage case of the Linux kernel. The fact UEFI secureboot currently is implemented on x86 does not handle the fact all 4 use cases need to exist is really a issue with UEFI Secureboot that needs to be fixed by those designing UEFI for the future. Allowing the kernel to be configured the 4 different ways does not mean a party like Microsoft has to sign off on everything the Linux kernel can do. Its not like android/IOT vendors have to bow to Microsoft. The Linux kernel should not show favouritism. This does mean that all 4 modes should be in the kernel configuration options. Matthew Garrett your mistake is that only 2 are valid when all 4 are valid in different usage cases. Circumventing security is sometimes required accepting that case is hard for some people. Of course when a party need perform circumventing security the fact that it currently gives out the keys to world of UEFI systems is a very big security design flaw in UEFI. Why should the Linux kernel contain code to work around defective design of UEFI and limit what users not using UEFI and using UEFI can do? Peter Dolding