All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Brendan Trotter <btrotter@gmail.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	Alec Brown <alec.r.brown@oracle.com>,
	Kanth Ghatraju <kanth.ghatraju@oracle.com>,
	Ross Philipson <ross.philipson@oracle.com>,
	"piotr.krol@3mdeb.com" <piotr.krol@3mdeb.com>,
	"krystian.hebel@3mdeb.com" <krystian.hebel@3mdeb.com>,
	"persaur@gmail.com" <persaur@gmail.com>,
	"Yoder, Stuart" <stuart.yoder@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"michal.zygowski@3mdeb.com" <michal.zygowski@3mdeb.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	"lukasz@hawrylko.pl" <lukasz@hawrylko.pl>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	James Morris <jmorris@namei.org>
Subject: Re: Linux DRTM on UEFI platforms
Date: Fri, 22 Jul 2022 13:23:09 -0400	[thread overview]
Message-ID: <f09fe749-e139-db6a-b2ad-45db76da04ae@apertussolutions.com> (raw)
In-Reply-To: <CAELHeEcEN=4YrPJROvzHoOiqqe5Bk0f8pDCZDnQ6aS=2LdwNow@mail.gmail.com>

On 7/7/22 23:36, Brendan Trotter wrote:
> Hi,
> 
> On Thu, Jul 7, 2022 at 7:18 PM Daniel P. Smith
> <dpsmith@apertussolutions.com> wrote:
>> On 7/5/22 20:03, Brendan Trotter wrote:
>> Greetings!
>>
>> Not sure why I got dropped from distro, but no worries.
>>
>>> On Wed, Jul 6, 2022 at 4:52 AM Daniel P. Smith
>>> <dpsmith@apertussolutions.com> wrote:
>>>> On 6/10/22 12:40, Ard Biesheuvel wrote:> On Thu, 19 May 2022 at 22:59,
>>>> To help provide clarity, consider the following flows for comparison,
>>>>
>>>> Normal/existing efi-stub:
>>>>    EFI -> efi-stub -> head_64.S
>>>>
>>>> Proposed secure launch:
>>>>    EFI -> efi-stub -> dl-handler -> [cpu] -> sl_stub ->head_64.S
>>>
>>> For more clarity; the entire point is to ensure that the kernel only
>>> has to trust itself and the CPU/TPM hardware (and does not have to
>>> trust a potentially malicious boot loader)..Any attempt to avoid a
>>> one-off solution for Linux is an attempt to weaken security.
>>
>> Please elaborate so I might understand how this entrypoint allows for
>> the kernel to only trust itself and the CPU/TPM.
> 
> Is this a serious request?

Yes, it was serious because I found the statements to be terse and open
to interpretation. Specifically, when I read it, it almost seemed that
the position is that dynamic launch is not needed, and that the kernel
could just establish its own RoT.

> Kernel is started (via. firmware using the kernel's efi-stub, or via.
> "kexec()", or..); and regardless of how the kernel was started the
> kernel establishes its own dynamic root of trust.(e.g. AMD"s SKINIT or
> Intel's TXT, followed by measuring the remainder of itself and
> anything passed from firmware like APCI tables) without relying on a
> call-back provided by "untrusted by kernel" third-parties that don't
> exist in most cases. The dynamic root of trust that kernel creates
> depends on the kernel, CPU, TPM, etc (and excludes untrusted and
> unnecessary third parties)..

This clarifies the previous statements and I would say, yes, this is one
approach. Considering the challenges we have/are facing in getting a
minimal post-launch handling (sl-stub) into the setup kernel, I would be
hard-pressed to believe adding all the pre-launch handling would be
found to be acceptable. If the intent is to have it completely
self-contained, this would require,
  1) the introduction of a TPM driver into the setup kernel, a hole I
     would rather not go down again
  2) potentially the ability to load files from disk if it is not
     acceptable for the bootloader to load the DCE (ACM/SLB)
  3) miscellaneous system evaluations, memory table, machine check, etc.

The only thing that is gained from such an approach is to make dynamic
launch for Linux be self-contained in the kernel. It does not reduce the
TCB because the whole design of the dynamic launch is to provide a
controlled process that establishes a new trust chain/TCB that is
started from an untrusted state. Specifically, dynamic launch starts
with the CPU being provided all the material for the process by
untrusted code that is currently in control at the time the launch is
initiated.

> The only potential benefit that the callback solution provides is that
> it, in theory, it could reduce duplication of work for other operating
> systems (FreeBSD, Solaris, Haiku, Fuchsia, .. could use the same
> callback instead of doing it themselves); but previous discussions
> (talk of formalising the contract between the boot stub and the Linux
> kernel) suggest that you aren't interested in any other OS.

With all due respect, but this is where I would have to disagree. There
is substantial benefit,
  1) a single code base that needs to be reviewed vs multiple OS
     specific versions
  2) establishes an API that decouples pre- and post-launch
  3) reduces the complexity required to enable adoption by an OS
  4) zero reduction in the security properties of the architecture

> This leaves me wondering what your true motivation is. Are you trying
> to benefit GRUB/Trenchboot (at the expense of security, end-user
> convenience, distro installer hassle, etc); or trying to manufacture
> scope for future man-in-the middle attacks (by promoting a solution
> that requires something between firmware and kernel)?

As a loyal member of the tinfoil hat brigade, I will always advocate for
accept nothing and question everything. All I can ask is to evaluate the
technical merit of the presentations [1][2][3] and the patch series [4].
If there is anything concerning with the theory or the implementation,
then it should be raised so that it may be addressed. A means to do so
is the "what if" game, as it is great to formulate a hypothesis. In this
case, the "what if" postulated is the assumption that the approach is to
allow a future MitM attack. Then the challenge is to examine the
process, their underlying mechanism, and the security properties of
those mechanisms to see if a MitM can be discerned. I will gladly engage
with anyone that presents an analysis demonstrating an assumption I
made/missed that opens the possibility for subversion of the launch
integrity attempting to be built.

[1] https://www.platformsecuritysummit.com/2018/speaker/smith/
[2]
https://events19.linuxfoundation.org/events/linux-security-summit-north-america-2019/program/schedule/
[3] https://lpc.events/event/7/contributions/739/
[4] https://lkml.org/lkml/2022/2/18/699


  parent reply	other threads:[~2022-07-22 17:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 17:40 Linux DRTM on UEFI platforms Matthew Garrett
2022-03-30  7:02 ` Ard Biesheuvel
2022-03-30  7:11   ` Matthew Garrett
2022-03-30  7:12     ` Ard Biesheuvel
2022-03-30  7:18       ` Matthew Garrett
2022-03-30  7:23         ` Ard Biesheuvel
2022-03-30  7:27           ` Matthew Garrett
2022-03-30  7:39             ` Ard Biesheuvel
2022-03-30 12:46               ` James Bottomley
2022-03-31  0:35   ` Daniel P. Smith
2022-03-31  7:13     ` Ard Biesheuvel
2022-03-31 10:59       ` Heinrich Schuchardt
2022-05-19 20:57       ` Daniel P. Smith
2022-05-19 20:57 ` Daniel P. Smith
2022-06-10 16:40   ` Ard Biesheuvel
2022-07-05 18:35     ` Daniel P. Smith
2022-07-06  0:03       ` Brendan Trotter
2022-07-06  0:12         ` Matthew Garrett
2022-07-07  9:46         ` Daniel P. Smith
2022-07-08  3:36           ` Brendan Trotter
2022-07-08  4:56             ` Matthew Garrett
2022-07-22 17:23             ` Daniel P. Smith [this message]
2022-07-23  5:15               ` Brendan Trotter
2022-08-09 10:53                 ` Daniel P. Smith
2022-08-10  9:07                   ` Brendan Trotter
2022-08-10 17:46                     ` Matthew Garrett
2022-08-11  9:55                       ` Brendan Trotter
2022-08-11 11:34                         ` Daniel Kiper
2022-08-11 18:25                         ` Matthew Garrett
2022-08-12  3:22                           ` Brendan Trotter
2022-08-12  5:54                             ` Matthew Garrett
2022-08-05 12:53       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f09fe749-e139-db6a-b2ad-45db76da04ae@apertussolutions.com \
    --to=dpsmith@apertussolutions.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=alec.r.brown@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ardb@kernel.org \
    --cc=btrotter@gmail.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=jmorris@namei.org \
    --cc=kanth.ghatraju@oracle.com \
    --cc=krystian.hebel@3mdeb.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz@hawrylko.pl \
    --cc=michal.zygowski@3mdeb.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=persaur@gmail.com \
    --cc=piotr.krol@3mdeb.com \
    --cc=ross.philipson@oracle.com \
    --cc=stuart.yoder@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.