Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp34925rwe; Tue, 30 Aug 2022 20:18:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR7vhKq9q/IWhameu074tyFrn1zGCIAOVOwn6PKkKkBHmZhoh1Kz0vsMjcRbPO/jjz32sHVN X-Received: by 2002:a17:902:c945:b0:16d:c318:4480 with SMTP id i5-20020a170902c94500b0016dc3184480mr24246817pla.147.1661915901885; Tue, 30 Aug 2022 20:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661915901; cv=none; d=google.com; s=arc-20160816; b=Ii6IK86Ii+RAviw3doq44KkVH8KvaT6ZCwhWA+Phq/HfjqFzGv2X3CchU3qnzL50iG AWpD+Txh85eUZhWHm0SnWjiG+gn4JBM1M2zYwiymQJSw+Wp1iz8UFtTMlUnfuoEWOpIf 3pw8QXPQLvqHFGwLygoE/WthiI+0/bc+7JOPljCMACp3UcazYiGMRZwLaaAiXK3g+QAE vBqOzC3XYrcBEL7itKOOOl87fq+ZToetLo4/ELc6AcznAIrIs8XIhx8vBbKeoL0pDiNy 8rPXasRezANDNIA/jDug9yfoWjreFX0Fwte1tPlE7pTRkf/Ys1j5BLJUrJjqSERYQYhL VMbg== 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=29uuO6GZtjDyuzzAp56HqbTAzM+bROkszmp5Wa2rPP8=; b=myZ52oXvwuaIxhQnVHEqAoKsJgf3EpeKmzXC8cR19hyaoW0dRMsPeBDxfovW61cQJ6 tb55S0MHp1BfM4zPJSxobVLkRARQ5mBg5EKtTYrQxApCb/y0mLc9y4PQyzK00OmfAo0R ivcLNGj1q1WsNi4f93vBd9esNDR+2shhkj5+hST0p/krlmn/VwQe2zIGRBpdsL/epTW4 05EcMj/bNxEAVxuE7m1mub7jLbutaj7WSrJ7lqzX9CcgFxfL96b4JM/EHPIW1MamUd27 c78b/FukQwrFx/N5wAI59y02DvX9IPTowlwBEz1kYxDq34mVpupInhFxDkX4/dKxom9S btug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WvAG5aG/"; 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 l10-20020a63be0a000000b0042b1b03af7asi3968939pgf.221.2022.08.30.20.17.48; Tue, 30 Aug 2022 20:18:21 -0700 (PDT) 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="WvAG5aG/"; 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 S232002AbiHaCsi (ORCPT + 99 others); Tue, 30 Aug 2022 22:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbiHaCsb (ORCPT ); Tue, 30 Aug 2022 22:48:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D6AB3B23; Tue, 30 Aug 2022 19:48:30 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 807A06192E; Wed, 31 Aug 2022 02:48:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6159DC433C1; Wed, 31 Aug 2022 02:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661914109; bh=HDZw+4aeyhFB+8/0wyIB8tKlUh9S28kYnuv3E3uguOE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WvAG5aG/hHeV1gHfHRfEO0l7SRfA4T6lBiLKHq8jHG9DGYWURWd1pfyfNm5CpQz+i CYrTD4GGdjHlZVwUWV9qM3QbbIUKg7oMfZmeSoWxbp/XNKWHCFc2UEr0aTgtjmTIO3 /Zi+UuDe98tzXQMQgg99DF/zS/tjB3Za0J7XsHxrFJIjKUI5+sEuObXse0Qhorigv3 +ks0pjNzuddDketown7oA8OKiLAZqC/Sqg5uL4clVmaustKf94RUnW9yIzgIfssWjQ hMidFpB1SQGAvPIYN+Vsf0+K+MK88umRoDZFSI8G7MWXx2i68EPRIp7atJ03gfWySI x6fyt+oiMgVAA== Date: Wed, 31 Aug 2022 05:48:25 +0300 From: Jarkko Sakkinen To: Matthew Garrett Cc: Ken Goldman , Evan Green , linux-kernel@vger.kernel.org, dlunev@google.com, zohar@linux.ibm.com, jejb@linux.ibm.com, linux-integrity@vger.kernel.org, corbet@lwn.net, rjw@rjwysocki.net, gwendal@chromium.org, linux-pm@vger.kernel.org, Len Brown , Pavel Machek , "Rafael J. Wysocki" Subject: Re: TPM: hibernate with IMA PCR 10 Message-ID: References: <20220504232102.469959-1-evgreen@chromium.org> <20220504161439.6.Ifff11e11797a1bde0297577ecb2f7ebb3f9e2b04@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,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-kernel@vger.kernel.org On Mon, Aug 29, 2022 at 02:51:50PM -0700, Matthew Garrett wrote: > On Mon, Aug 29, 2022 at 2:45 PM Ken Goldman wrote: > > > > On 5/4/2022 7:20 PM, Evan Green wrote: > > > Enabling the kernel to be able to do encryption and integrity checks on > > > the hibernate image prevents a malicious userspace from escalating to > > > kernel execution via hibernation resume. [snip] > > > > I have a related question. > > > > When a TPM powers up from hibernation, PCR 10 is reset. When a > > hibernate image is restored: > > > > 1. Is there a design for how PCR 10 is restored? > > I don't see anything that does that at present. > > > 2. How are /sys/kernel/security/ima/[pseudofiles] saved and > > restored? > > They're part of the running kernel state, so should re-appear without > any special casing. However, in the absence of anything repopulating > PCR 10, they'll no longer match the in-TPM value. This feature could still be supported, if IMA is disabled in the kernel configuration, which I see a non-issue as long as config flag checks are there. BR, Jarkko