Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp141552rwn; Wed, 7 Sep 2022 13:58:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR4J4OWK2HRh5Tbf/OSA4iOs9Ci/jq3ryN5jas3Vdg0R7cmHexGm0oEtCRDpSrFRg+yoAFvV X-Received: by 2002:a17:90a:b00b:b0:1f1:6023:dacd with SMTP id x11-20020a17090ab00b00b001f16023dacdmr383739pjq.184.1662584306974; Wed, 07 Sep 2022 13:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662584306; cv=none; d=google.com; s=arc-20160816; b=FCMMPu/GXBHKILjYC6PoHzmxTGe627jrT9RA46xzGn16F19/O0d/eQlz+aXhAiB/6n Z0PXHUTfUXUllEEF0IdaQFp9mS7gvW0CG+n6yyuZQfENDuB6WnVyJ5uBiI8MhtUqRYFL jQkwvkQ/VYfmbJZu+nE1v/rJZN0uR7xMRAsVy4D9/Uu7K1cT1bpWPHjI2brNrt06JIC7 CMJWpd1ysPvmRvfoBFqbEKp7tLidoq9dBGqRNgGCaIVI9+yH3cX8aJKbhicu3cr7eQ+H MZYLoCWzl1xYYJcchMlqg6KzsclEteWtFwCEsm8zFVklxQiHGHmafbsiOy55uHaJ3TWZ MXDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YASIjzw1LDe+VKtphl3/fRbVIDxJaus83cpKP5HNsyw=; b=g4N5v+wi5dWYVTOu3KWaa/mIx8FFm6efRzx7oDWCGNLQZhqRosFYXzdik91LYdPX0I 9VOPQmxgb9PYFiFTwAOHxWY2+ZFLfcsExmIm4Hwq8QlKSuYsAShA/Z1gnpljWKwrdlil U2VDBXo5huT+oXucyTgSpowUBiWP/n4zMQv0mqttWh87daUWSYTV5aaHlthUG6LQ0cf0 G3GPeHIZSuQRLs2oK3IBh9ChtFm6qkFp6mj8iE/jIaGxzPrvqJgRCSx3IBHakmWRFYf6 LPWOOgfZF3U4AOE3RcuOIR8R4YYD8LeTAz9baOw09+gvtbZ7pb4sc4J6CAWkRCrQCQUL ynhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VoDi7KKv; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a17090abb8400b001fd699adb27si141872pjr.127.2022.09.07.13.57.53; Wed, 07 Sep 2022 13:58:26 -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=@chromium.org header.s=google header.b=VoDi7KKv; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbiIGUs3 (ORCPT + 99 others); Wed, 7 Sep 2022 16:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbiIGUs1 (ORCPT ); Wed, 7 Sep 2022 16:48:27 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB31C22A9 for ; Wed, 7 Sep 2022 13:48:25 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1225219ee46so39128428fac.2 for ; Wed, 07 Sep 2022 13:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=YASIjzw1LDe+VKtphl3/fRbVIDxJaus83cpKP5HNsyw=; b=VoDi7KKvOVMlkNb6NTLmj1/EUmOIK4dTzEbszNq5fElMHLBSt5uVH2td68MJlNQqR5 FajYEDywytSduxtlHZLRoxWfpLh5I+3SiR55tKsuUiTaAZLra7Uh17k/CWM8sjcpr+Gs a67vn3vjtsB2deaAuScN0Zt7lmSAj/aZScSoQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=YASIjzw1LDe+VKtphl3/fRbVIDxJaus83cpKP5HNsyw=; b=i2s6id9rMNQarGItRimsVM8KYk4s6feXAMeAlBmzG85uzDWK/lB3cJ9tLjDhR7X7zK SQRW+8w75N1LpUuhf9xYpii007KmWUeYjblj1+eW0bmHzADpjfytgUGj7pBv/LHiPAYc tjGj7BSeMuTlJ3n+nByNZTnG0663zPnSG4QungyeT0nVzIUrGUASgQ7MIaA12lGnpsJo pmWMlYAg/VBqD27uCNc09gtv4juFb2A38VX7TYSm15IcKRhW0up2MmZn9o+SkMC1L0Vc +/fmIMc36OWedbbxPruRom/lQkcXinBg4G92le1AgoN5jEugKtQ1PYnHuNxp9+lF2XOc 8kmw== X-Gm-Message-State: ACgBeo2JmHGoIQ+oqzFtTbNTM0OtRtaylSd7y+/RYSUti4MgxeFlK2+Y 1wTY9VJAiC1DP99Se4KByjzVGtcGYgl93Q== X-Received: by 2002:aca:1901:0:b0:344:d4b5:9a1f with SMTP id l1-20020aca1901000000b00344d4b59a1fmr123393oii.170.1662583704402; Wed, 07 Sep 2022 13:48:24 -0700 (PDT) Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com. [209.85.160.41]) by smtp.gmail.com with ESMTPSA id j24-20020a4ad198000000b00435a59fba01sm5387810oor.47.2022.09.07.13.48.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Sep 2022 13:48:23 -0700 (PDT) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-12803ac8113so5752783fac.8 for ; Wed, 07 Sep 2022 13:48:23 -0700 (PDT) X-Received: by 2002:a05:6870:b28c:b0:127:ad43:573e with SMTP id c12-20020a056870b28c00b00127ad43573emr171693oao.174.1662583703304; Wed, 07 Sep 2022 13:48:23 -0700 (PDT) MIME-Version: 1.0 References: <20220504232102.469959-1-evgreen@chromium.org> <20220504161439.6.Ifff11e11797a1bde0297577ecb2f7ebb3f9e2b04@changeid> In-Reply-To: From: Evan Green Date: Wed, 7 Sep 2022 13:47:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: TPM: hibernate with IMA PCR 10 To: Jarkko Sakkinen Cc: Matthew Garrett , Ken Goldman , LKML , Daniil Lunev , zohar@linux.ibm.com, "James E.J. Bottomley" , linux-integrity@vger.kernel.org, Jonathan Corbet , "Rafael J. Wysocki" , Gwendal Grignou , Linux PM , Len Brown , Pavel Machek , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, Aug 30, 2022 at 7:48 PM Jarkko Sakkinen wrote: > > 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. Right, from what I understand about IMA, the TPM's PCR getting out of sync with the in-kernel measurement list across a hibernate (because TPM is reset) or kexec() (because in-memory list gets reset) is already a problem. This series doesn't really address that, in that it doesn't really make that situation better or worse. -Evan