Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2207650ybd; Thu, 27 Jun 2019 08:30:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy09y5oWeICSCc0f5/b9ACUCcZWSp9Iiob/tE24EXedoVGL00j4xjVmBKjN7oArsWeF5W5+ X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr6928975pjd.70.1561649427008; Thu, 27 Jun 2019 08:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561649427; cv=none; d=google.com; s=arc-20160816; b=HHfSchrKyvZXcfn5DWnKW16LzS48o6BQmvdsqfAstg18YOZ9Xx/WKGcqcTvj4NkYE2 ThNYgQ0ik+KowUueGkOP74yWGazwXSLiqDyqiwmmo7WW44RcGnaxDl+o5x2mMfNJ91KK CRbEL+CIMWxW6u0MmnPD/QgPG8JxdT22EWOsx+0drUuBNosA7WZsoh/ey6W7SGPMV9IU eir5euy4lxggmLO6TBfhyUY1yxPULGEps7QmbG2TdBNvljl3XFL2goSFBpaNKVSyt38F RXQF9gUA7OTFV4wSd8Vy+psS6tePoLdeE2/1gNlNajOdkvePvkhhOIhGI4djO2OpGVyT Tu0g== 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 :in-reply-to:references:mime-version:dkim-signature; bh=g3RhI9DNvqsR2Iknx3LGGvk1u88PumHwEAJh9YfsKq4=; b=R2gTZLikY9y8AL6XqHti0JsP515pCmBB/mD6SSHHFGo5q9I4ByFSzosO1EGMCmyJMu r3ArXwWQlN4rAfKP0eFW3+Cyt7ASjl6mNmguzvF92fzlFglJB4LtZKqVowTgBUSeVhYr rq8D1hW1WyWaeP6Zv3Fx0OWK3leU41MLNmPs94DR80IswIQvBFbtDcHsQGX/rIvzq7kd NGjY18poTYKgvi0Rrs26d2TfOCFYi2NTN5Lo/uH7EpMLNiVKsM1gcxsngHLj/C+uXCAF AU/vlOhpY7LIKHsBCgsj9ZzFSXhcj7U6iqflcNHWj+YQRTsqSoxpGJHYLMwIlKV+Ayht ym8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gekKU/tG"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si2340404pgv.195.2019.06.27.08.30.10; Thu, 27 Jun 2019 08:30:26 -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=@google.com header.s=20161025 header.b="gekKU/tG"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbfF0P2V (ORCPT + 99 others); Thu, 27 Jun 2019 11:28:21 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:33770 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbfF0P2V (ORCPT ); Thu, 27 Jun 2019 11:28:21 -0400 Received: by mail-io1-f66.google.com with SMTP id u13so5700806iop.0 for ; Thu, 27 Jun 2019 08:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g3RhI9DNvqsR2Iknx3LGGvk1u88PumHwEAJh9YfsKq4=; b=gekKU/tGlO7Mg0UGCOLXXY+Ire65Q4Z2qg5wd1h/tWU9dzP0OjY9RAukwLeQIBSiqO lOzOnp3OUJGMVLjCBBaxpYTOR7n0lu7pDCECDHHB+ew+MrRhPUsJ0/NzKMwdsdcqH0Ov 7lUBWw8BNh134qpS92lj0nucRNsTHYxeobnt31H/hqDGy9ghty4FICuN8yjUcc9NWF/6 905EiAC6mqg4SnIM0fMAjsXUMLsqln3Od29lkC8l+/yuWFoRGhklNh7wu6HdgobanftQ uCGE/qdCkvuTW0BOqRXIuGm5aMHPy5aZt2n/GNm5dIfAcnbAFzKIOR34tkMtJDQm0I8O xIiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g3RhI9DNvqsR2Iknx3LGGvk1u88PumHwEAJh9YfsKq4=; b=WwrmCR/qdBw+kPy/Bb+B06uBfvTpNQdp9xscHmYQdW6/lCdIipH3kES9/IXypwWK+g hxu0rIiexrpv1gngRsfG7rZBPoiGPCkv/uVptk/6Z8Dn/B9VRgZs/FW5gKKRZ6By5Gay Lp1NjNDlfPosw1VDeMGAUIabUku/a1jAEsdShobkUJ6VJRvoI1VBs6vp9cEMW1uTXKAm vSv5ezrkAoJtjPJhifK0mtV60tZqjljD78S9PULqqAcy4fNKtGynkH1/E+aIwnLXJJxK HzY2ocuyyrK2H4wXKr+ErE6AubuCDFNsTF4oRNcyTogdN92PfpMWYYxpWn5UfYzVXNP/ SQYg== X-Gm-Message-State: APjAAAU/7nrU/kyHFEgIN43WqnfvkIN8jmcVP6dXdgy10tDbg3W6TeSL rOWIuUkIv/RmfkyIQ4/HPOJbMSQ4VXqS3ruDlNCYnA== X-Received: by 2002:a5d:9d97:: with SMTP id 23mr5395263ion.204.1561649300148; Thu, 27 Jun 2019 08:28:20 -0700 (PDT) MIME-Version: 1.0 References: <20190622000358.19895-1-matthewgarrett@google.com> <20190622000358.19895-10-matthewgarrett@google.com> In-Reply-To: From: Matthew Garrett Date: Thu, 27 Jun 2019 08:28:08 -0700 Message-ID: Subject: Re: [PATCH V34 09/29] kexec_file: Restrict at runtime if the kernel is locked down To: James Morris Cc: LSM List , Linux Kernel Mailing List , Linux API , Jiri Bohac , David Howells , kexec@lists.infradead.org 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, Jun 26, 2019 at 9:59 PM James Morris wrote: > This is not a criticism of the patch but a related issue which I haven't > seen discussed (apologies if it has). > > If signed code is loaded into ring 0, verified by the kernel, then > executed, you still lose your secure/trusted/verified boot state. If the > currently running kernel has been runtime-compromised, any signature > verification performed by the kernel cannot be trusted. > > This problem is out of scope for the lockdown threat model (which > naturally cannot include a compromised kernel), but folk should be aware > that signature-verified kexec does not provide equivalent assurance to a > full reboot on a secure-boot system. By that metric, on a secure boot system how do we determine that code running in the firmware environment wasn't compromised before it launched the initial signed kernel?