Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1751562ybz; Thu, 30 Apr 2020 05:01:06 -0700 (PDT) X-Google-Smtp-Source: APiQypIJCjMZ+NZdLfQtgrKPt+IohHPxh2beWdw7482qgcbBlbTa1QzDdgakO12LXAIFIRXIezi5 X-Received: by 2002:a17:906:f0d9:: with SMTP id dk25mr2283497ejb.266.1588248066269; Thu, 30 Apr 2020 05:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588248066; cv=none; d=google.com; s=arc-20160816; b=G3Z1/vg2jzyAGj5JNtXGkd1bi7/4dGoGp/JOtg2GzijgGdFgAHyXJYOyptz96K7mk0 e8YRDmmOlw4c3vqE2kfq/LkVlsa/AsjzJqogqzaZE41db75wxcIUY4BehIuR6yKCPGmE zATHwuqKMWyUFZI2l8G+L7qdV5taZ4i85x8mLNmNLT6pAjzGxBewqUqbaX2uHl2Wnk2M tauNRbrWgNULBrl37OPEiroaMgvmzDMarjBq7qGJDpsxItI4lEjD8oUEjvgLUnLL8ggv 4Fb1priJix25aldE+vXJg8och6R0qhF1ro/LlB3xZsY6R869G6PzATJ4oaEJih8gufSJ aCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PwkVlLlTF6QMPUlS0NrS9fdfO5mc8bH+SjES/5fPWp0=; b=Jna5FFRDHXaAkPdxSmF2X1Mg9GqRY9dOPlDbDkeAPN71Clsd1VU4eZc5sdRDrn6hPk EP+ZbdarkJsdXOPrCKgvWJX08h67SarT+et7feSSiFgxgbg6PZXHqxhJDgjWEBUna8UQ tkOoW0J5SomjKs5J6Z6FwWyR2AWN9F0p29qcailJADdGZvSa7UV1FYsTFwP0On0AuRcG /JWj30+c5/Gr7GW81YSwN0cyKHf54HQybHbom9U8kW0MbJYXbTlPSdUv4Q9zULU+HV1t f4VxrGVKfo15wZlYHGxho8wdnX3WQZdrG1ZL9GSdBJn1a2UVUHCU0XUWEIzDCGOHEKV6 94Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QjdzC+xT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si5456209ejm.84.2020.04.30.05.00.42; Thu, 30 Apr 2020 05:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QjdzC+xT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbgD3L6W (ORCPT + 99 others); Thu, 30 Apr 2020 07:58:22 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:44424 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726413AbgD3L6V (ORCPT ); Thu, 30 Apr 2020 07:58:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588247900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PwkVlLlTF6QMPUlS0NrS9fdfO5mc8bH+SjES/5fPWp0=; b=QjdzC+xT2f1d+EnrxUgCZILGUiCMQrwuqMVA4t8vQLwIqi61JF55x7Qha1IdEWuK6D9N47 5JxWVcK7tv0DinU4Q4y3oj4b3ZQ8DTDkBB/v2ByRV7Kffw+94q/FigFFfvL9LjbWeuZo5N Pz0IqbyIXolsbRdq5+5jn/UXt3LD+0A= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-Pkh3iidcPvajLB6mGZCJgQ-1; Thu, 30 Apr 2020 07:58:18 -0400 X-MC-Unique: Pkh3iidcPvajLB6mGZCJgQ-1 Received: by mail-wr1-f71.google.com with SMTP id q10so3740087wrv.10 for ; Thu, 30 Apr 2020 04:58:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PwkVlLlTF6QMPUlS0NrS9fdfO5mc8bH+SjES/5fPWp0=; b=TOLE8SSN3/KfjYWZzxWCkGGy6EQFNuLXiZrd/7paPtUfLFRIk5qCVwnJwQKViJdGot SslvYeKrwdC4v87yqHKnrgpln94l8bBw7ZwVkQhxHdPHuFjjdffwrPDvgbnLbbaozNvz 3OLXgZ1SSpY6PL4W2l76N06OSOhGvi24fnRWabeVHW9AluZbmb/Eqr2vR03criRbaG45 PdDOAMHKwOUVefJSuO4sL/SNDKuAvfziacATrmByiXbt/I2pSSmzDRcQPaFg3tcpVIA4 rjJN/g6t7zeo7FT/1n01AwbPmwh0PfjbYc1cK+9Pd8eUsa6hv3Ejhspeee8ePjJss9iF SJ/g== X-Gm-Message-State: AGi0Pua4VmACtDZ5UkXXjL7G+fBzzDJD/lmz8aG9/L4ylAqMCfNzWNEw PpJ3M9lbYlomfaQ0ERJGgFPl8c+aYB5XX17UcWl8TnesCX/8tvr+GCqyiEQNMk7eakbLPypEhcd X7iitJvFl0U/1VZTptoc2Q2tH X-Received: by 2002:adf:ce0d:: with SMTP id p13mr3952868wrn.66.1588247897407; Thu, 30 Apr 2020 04:58:17 -0700 (PDT) X-Received: by 2002:adf:ce0d:: with SMTP id p13mr3952839wrn.66.1588247897133; Thu, 30 Apr 2020 04:58:17 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:ac19:d1fb:3f5f:d54f? ([2001:b07:6468:f312:ac19:d1fb:3f5f:d54f]) by smtp.gmail.com with ESMTPSA id b12sm4006595wro.18.2020.04.30.04.58.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 04:58:16 -0700 (PDT) Subject: Re: [PATCH v1 00/15] Add support for Nitro Enclaves To: Alexander Graf , "Paraschiv, Andra-Irina" , linux-kernel@vger.kernel.org Cc: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Martin Pohlack , Matt Wilson , Balbir Singh , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com References: <20200421184150.68011-1-andraprs@amazon.com> <18406322-dc58-9b59-3f94-88e6b638fe65@redhat.com> <2a4a15c5-7adb-c574-d558-7540b95e2139@redhat.com> <1ee5958d-e13e-5175-faf7-a1074bd9846d@amazon.com> <80489572-72a1-dbe7-5306-60799711dae0@amazon.com> <0467ce02-92f3-8456-2727-c4905c98c307@redhat.com> <5f8de7da-9d5c-0115-04b5-9f08be0b34b0@amazon.com> <095e3e9d-c9e5-61d0-cdfc-2bb099f02932@redhat.com> <602565db-d9a6-149a-0e1a-fe9c14a90ce7@amazon.com> <0a4c7a95-af86-270f-6770-0a283cec30df@amazon.com> <0c919928-00ed-beda-e984-35f7b6ca42fb@redhat.com> <702b2eaa-e425-204e-e19d-649282bfe170@amazon.com> From: Paolo Bonzini Message-ID: Date: Thu, 30 Apr 2020 13:58:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/04/20 13:47, Alexander Graf wrote: >> >> So the issue would be that a firmware image provided by the parent could >> be tampered with by something malicious running in the parent enclave? > > You have to have a root of trust somewhere. That root then checks and > attests everything it runs. What exactly would you attest for with a > flat address space model? > > So the issue is that the enclave code can not trust its own integrity if > it doesn't have anything at a higher level attesting it. The way this is > usually solved on bare metal systems is that you trust your CPU which > then checks the firmware integrity (Boot Guard). Where would you put > that check in a VM model? In the enclave device driver, I would just limit the attestation to the firmware image So yeah it wouldn't be a mode where ne_load_image is not invoked and the enclave starts in real mode at 0xffffff0. You would still need "load image" functionality. > How close would it be to a normal VM then? And > if it's not, what's the point of sticking to such terrible legacy boot > paths? The point is that there's already two plausible loaders for the kernel (bzImage and ELF), so I'd like to decouple the loader and the image. Paolo