Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2617797rwd; Mon, 15 May 2023 14:25:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gPnSVszv4QP0Lqy2rl2OlllWPVpz04kXRGHJmMmu0BOcmvtHUUY9Lu6WMgiKwcrzg3nRy X-Received: by 2002:a17:90a:5644:b0:24e:358a:2c6b with SMTP id d4-20020a17090a564400b0024e358a2c6bmr33472375pji.40.1684185940744; Mon, 15 May 2023 14:25:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684185940; cv=pass; d=google.com; s=arc-20160816; b=fqSAyBowEX2S7UMi7+2Uy30J6SkNZsGIqk/IAaDg77yZcfbskuifTJ91tWc7afl1Yj Qa0X8hxdFi1gTh1xLPKUgRtsZOcd0LeIUBX6O+waF2X9OvBOB1/Jp7iK/rCI9LFpRrH5 otmYZ/DFmlT/+xljLP7lGuk9h5DS7f2rVhHNoOACVO9Y8fT7UqPui9NswyQ5ONvlLFfi zSkcNSbKvHw9LWgD11bZ12+M64uLkDJyTYIVOGJg5G8etfsKB2V9zMnzF6+80FBUuqw5 s5+Z+mKwqUB9sBBJKQZbpr7AZrWkhTS6C/uq5yJ5Wu6jefwKplHMFSZnXYJ9TPVZz4so Z0Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=opLqZdRYHF3ys1ryY1OchQpGACCzgW4qUUvF6rqdT3c=; b=BFWmCyz3iVFcT/fEqJ4RvoObOmrcxcEUWPAQQ4HSmK5/9WnKBcdsSe6Ldgb+kLzZ2d L8DES0py4+wGT+bsp5qVM0wnrOues0D8Hk8eELpNaCKdNzQifXL2G2qph0aj2mpAUEru 91jLp0nI44pLczT4PFEak5juDlkNpZ/VhylNhJW4+LY40CmLpkChRnv5S6/YuJaIYdjd QMv69st0m4TuYuerd33uoyhIkH8jKBBwZa/MZ/2/DHrvxhMQiUXiRulXzQOABVemtoyX fd49jJNWGOAsQaEDhdYGrbcJ4haD0KcwVrVdaxCTQhy7D0z62NwVkehYeAmlAQ7irW3t /i+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@apertussolutions.com header.s=zoho header.b=H+wJhL5Q; arc=pass (i=1 spf=pass spfdomain=apertussolutions.com dkim=pass dkdomain=apertussolutions.com dmarc=pass fromdomain=apertussolutions.com>); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r30-20020a638f5e000000b005196bc25628si17661885pgn.579.2023.05.15.14.25.21; Mon, 15 May 2023 14:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@apertussolutions.com header.s=zoho header.b=H+wJhL5Q; arc=pass (i=1 spf=pass spfdomain=apertussolutions.com dkim=pass dkdomain=apertussolutions.com dmarc=pass fromdomain=apertussolutions.com>); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244187AbjEOVQI (ORCPT + 99 others); Mon, 15 May 2023 17:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244356AbjEOVQH (ORCPT ); Mon, 15 May 2023 17:16:07 -0400 Received: from sender3-of-o59.zoho.com (sender3-of-o59.zoho.com [136.143.184.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3024A256; Mon, 15 May 2023 14:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684185320; cv=none; d=zohomail.com; s=zohoarc; b=G/YHsvj6/b/7CAFV2mUx8G2APTL3FuWMoufRrCO7kCXu1zNMPCx6atooXg2cN8530h0MQywhQ0EayF3xeY5YKLjnAxpJr8lL1NUajaB5vBEP1ZV/AsKStIEP/911jhMFhQMbUJ+C8qCkysgy16gh6t7c9iVVwsTOoOP3VpiwpwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684185320; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=opLqZdRYHF3ys1ryY1OchQpGACCzgW4qUUvF6rqdT3c=; b=YpUk6rN9GBZQjC2bIFrjqmQCUOfWscDtTcsCXqEdu/jwdJcWXY4IT4I5bCG+PGBBrfPTLKZ3XvTPQrMAko9c5B8MWx1CnInPjEeKCz311/XuuXinet/MC4UN6AiiRC2WginEECTtHYsNUel3Dtc/UdyloAShTmMVnYnv6NJd/io= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1684185320; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=opLqZdRYHF3ys1ryY1OchQpGACCzgW4qUUvF6rqdT3c=; b=H+wJhL5QefRj2CwgFKv38emkOe4zX8bV3SyWcbHaRRyjgYFU6C6zbFqD9f9+Veon Ye/XC+6KrHMJbOE9p2lxX1NDXY/B5+XHt8SFNP8Wv1cyopWq5Bx7hTGVQfw5iNwY8mY Owii2fofpSsaFXmlehYYeDDuzt7U0aYLlCMA+iQc= Received: from [10.10.1.128] (static-72-81-132-2.bltmmd.fios.verizon.net [72.81.132.2]) by mx.zohomail.com with SMTPS id 1684185318079382.6343558445345; Mon, 15 May 2023 14:15:18 -0700 (PDT) Message-ID: <30d5891d-4747-8d67-2667-ff07628740bd@apertussolutions.com> Date: Mon, 15 May 2023 17:15:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v6 04/14] x86: Secure Launch Resource Table header file Content-Language: en-US To: Matthew Garrett , Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, ardb@kernel.org, James.Bottomley@hansenpartnership.com, luto@amacapital.net, nivedita@alum.mit.edu, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com References: <20230504145023.835096-1-ross.philipson@oracle.com> <20230504145023.835096-5-ross.philipson@oracle.com> <20230512105554.GB14461@srcf.ucam.org> From: "Daniel P. Smith" In-Reply-To: <20230512105554.GB14461@srcf.ucam.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ZohoMailClient: External X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/12/23 06:55, Matthew Garrett wrote: > On Thu, May 04, 2023 at 02:50:13PM +0000, Ross Philipson wrote: > >> +#define SLR_TABLE_MAGIC 0x4452544d > > From convention I'd expect this to be 0x534c5254, but not really an > issue. Apologies, but which convention? >> +/* SLR defined bootloaders */ >> +#define SLR_BOOTLOADER_INVALID 0 >> +#define SLR_BOOTLOADER_GRUB 1 > > Oof. Having the kernel know about bootloaders has not worked out super > well for us in the past. If someone writes a new bootloader, are they > unable to Secure Launch any existing kernels? The pragmatic thing for > them to do would be to just pretend they're grub, which kind of defeats > the point of having this definition... Actually, this is not for making the kernel know about bootloaders. This is dealing with the challenge created when the preamble was split for efi-stub, and similar use cases, where what sets up the preamble, ie. the bootloader, is separate from what invokes the dynamic launch, ie. the DLE handler. The reality is that even in the simplest implementation of the DLE handler, a remnant of GRUB for call back from efi-stub, there is information that is needed to cross the gap. >> +} __packed; > > Random nit - why are they all packed? Are there circumstances where two > pieces of code with different assumptions about alignment will be > looking at a single instance of a table? It doesn't seem likely we're > going to be doing DRTM in a 32-bit firmware environment while launching > a 64-bit kernel? We wrote the TrenchBoot Secure Launch general spec [1] with as much forethought as possible for the target environments. Specifically, the desire is to have a common approach for x86 (Intel and AMD), Arm, and perhaps down the road the POWER arch. In particular, I do not believe there is anything in the Arm DRTM beta spec that prohibits a mixed 32/64 bit environment. In the end it is better to for the spec to be safe for those environments then having to make changes to the spec later down the road. [1] https://trenchboot.org/specifications/Secure_Launch/ v/r, dps