Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3602781rwb; Fri, 20 Jan 2023 19:47:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6t8imgz7jsppRAlxHcYGP11RVRP0V2o8GCMohnlP6D+UuScQrafXdhFukIqoH+uyGKO1s X-Received: by 2002:aa7:db83:0:b0:480:f01b:a385 with SMTP id u3-20020aa7db83000000b00480f01ba385mr29968967edt.4.1674272868902; Fri, 20 Jan 2023 19:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674272868; cv=none; d=google.com; s=arc-20160816; b=ZIGach8vQjtDu30Hq2XPXgaiERq79Td1/DdTMdDo+OITP0hQpadwswg+WP7D2LvAWU Z8owOnhRe4QsQ13o6rU4T8YRi0vgrnr+Q9ye2R9qPZdBPpEclbqHSCh47q1/OGd/cl7T 6t/fZ3N1tLIQ4DZghTTFMWa1vmz8CsuCrIIuTNm5r1p6ipLuwWPP2Pi3mtZ8MOPKMFDW mvEWb3J0uhVmFK5uL0HddMOcItawks6DPylhs4r2MapE2ItLGp1wODClU9Zv2mAVa2Uy t+T5v7DsNUkMn8z1nDUFmYhVjX7X5IxegHm/Fd/zZ0IvBld9xrZp1Pf1AWxd/2i2NkCz eTKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kB5wvnGHfpneJ+hfPRx6QX7okIygOKr2z5Q8F0H87Ls=; b=pYUkX8h9LjZ2ZHkwixKsFwOcLMV04y8Xe8Se5xuOEudj3JTMD5pr5cQ9DMA/vIWHnr bCLTNs2oH54uUnvob3rx/zw4jR3hCBxAGHH7eBHEVKVNSCHK1b3KzsNhT38o6YUwCsLK zAdhOUwJ39zgMrRIaII1Fozblct62H1MQvLYTmwMOfv1hOs2K+0S4wKhMQSG+tEKU+6p VhWQfC8FxJ7oiOUFefr1IIoUTA9NCO3oRgwvtN/PeM+HxvKb9CuwtWP9y3Sc78TTCRDD /xjt2/+ir7YtlY/2GLRr+NiXt11iBnwlFNf3a7GHIV+G5A5Mlii/k690DrkmYw2ur1C/ ILZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=er5t2tAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a0564020f1500b0049e0689f005si21727427eda.341.2023.01.20.19.47.36; Fri, 20 Jan 2023 19:47:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=er5t2tAS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbjAUD33 (ORCPT + 50 others); Fri, 20 Jan 2023 22:29:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjAUD33 (ORCPT ); Fri, 20 Jan 2023 22:29:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E226E0FE; Fri, 20 Jan 2023 19:29:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A6825B82B88; Sat, 21 Jan 2023 03:29:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCBEDC433D2; Sat, 21 Jan 2023 03:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674271765; bh=AYvipXoxxMR9pl1bocKxT+7lCm00qzXfNi41jjeo4Wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=er5t2tASHFYKk0OJBKJiOnxjFVaDN8aKTqe5xn+MrOB/ee4MvR51nUO9noQhy8ixC 8LVSuNl4hE82lJEJhkGKLcmr8yEWcSg12B5bD78uuFfAlA1a0f45pXWPPELTn7HFsp UmkjL6bAwgo5Mzp7gsQbjKWrawcOdJSsesLK5oMCaPLx0YgEiJ6Xafj9M5heyPYyWM TZ/LAkDLnAjrX5k7svpFn5dDcOlM/5o2Iz1cXdNYtMNGTi+t8zGlOo7kgf1cMpKVwW e1PNaqP2R10Yw8S9ueD/Lkpa75UtJIomzvQZreAZBp/tIjJ9J4W6Fu9r8o1Kl2fj5a bl65PtvH+NoQg== Date: Sat, 21 Jan 2023 03:29:22 +0000 From: Jarkko Sakkinen To: James Bottomley Cc: Matthew Garrett , William Roberts , Evan Green , linux-kernel@vger.kernel.org, corbet@lwn.net, linux-integrity@vger.kernel.org, Eric Biggers , gwendal@chromium.org, dianders@chromium.org, apronin@chromium.org, Pavel Machek , Ben Boeckel , rjw@rjwysocki.net, Kees Cook , dlunev@google.com, zohar@linux.ibm.com, linux-pm@vger.kernel.org, Matthew Garrett , Jason Gunthorpe , Peter Huewe Subject: Re: [PATCH v5 03/11] tpm: Allow PCR 23 to be restricted to kernel-only use Message-ID: References: <20221111231636.3748636-1-evgreen@chromium.org> <20221111151451.v5.3.I9ded8c8caad27403e9284dfc78ad6cbd845bc98d@changeid> <8ae56656a461d7b957b93778d716c6161070383a.camel@linux.ibm.com> <08302ed1c056da86a71aa2e6ca19111075383e75.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08302ed1c056da86a71aa2e6ca19111075383e75.camel@linux.ibm.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org On Sat, Jan 14, 2023 at 09:55:37AM -0500, James Bottomley wrote: > On Tue, 2023-01-03 at 13:10 -0800, Matthew Garrett wrote: > > On Tue, Jan 3, 2023 at 1:05 PM William Roberts > > wrote: > > > > > What's the use case of using the creation data and ticket in this > > > context? Who gets the creationData and the ticket? > > > Could a user supplied outsideInfo work? IIRC I saw some patches > > > flying around where the sessions will get encrypted and presumably > > > correctly as well. This would allow the transfer of that > > > outsideInfo, like the NV Index PCR value to be included and > > > integrity protected by the session HMAC. > > > > The goal is to ensure that the key was generated by the kernel. In > > the absence of the creation data, an attacker could generate a > > hibernation image using their own key and trick the kernel into > > resuming arbitrary code. We don't have any way to pass secret data > > from the hibernate kernel to the resume kernel, so I don't think > > there's any easy way to do it with outsideinfo. > > Can we go back again to why you can't use locality? It's exactly > designed for this since locality is part of creation data. Currently > everything only uses locality 0, so it's impossible for anyone on Linux > to produce a key with anything other than 0 in the creation data for > locality. However, the dynamic launch people are proposing that the > Kernel should use Locality 2 for all its operations, which would allow > you to distinguish a key created by the kernel from one created by a > user by locality. > > I think the previous objection was that not all TPMs implement > locality, but then not all laptops have TPMs either, so if you ever > come across one which has a TPM but no locality, it's in a very similar > security boat to one which has no TPM. Kernel could try to use locality 2 and use locality 0 as fallback. BR, Jarkko