Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp127810iob; Tue, 17 May 2022 21:09:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNHOPfSQXY8IMbqxV2n3mRyse0JE5xUzoCf76+pgyD0APykwGjPJadVyFggMnOoaBpVgK5 X-Received: by 2002:a17:902:dacd:b0:15e:a53e:3239 with SMTP id q13-20020a170902dacd00b0015ea53e3239mr25286127plx.7.1652846963486; Tue, 17 May 2022 21:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652846963; cv=none; d=google.com; s=arc-20160816; b=bjZ1sUZqXSQ9fnnDQRZ7+RlD4VH8HS0/MIaE9Pb057rI0LzgERpL4ck5aeWbUQTmw+ +f/7RX9j8T8/rmG4V+jE7GAgk8uasPY7yQIK2GNxDK8FrmCDa5oRlsljIG0oTG4iP+XB NUUMSf2onKX0qdjltQLdGMmfJDMDMyHLnY7RaTJGqMShB0iBk/avjXdAlQnklrNvpI2X dbBoz+gWYxPooHPcnoa2SxhE9NOIIIi/rH7gQDYfgPfn12wRoYCE/JKN/lcLTj4TEuWw bp0YProYt7qItzd9Vp47iKSu9RIYSwlIGCqH+ERDvKmdXFpCviu3zTn9weVYzuBHp3SG 3UGg== 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=eg7EH5Vrvb2fKjVFmkcCg9Zq9x2kct9i+zNiZ3Rb9nE=; b=Y4dcYRTJ0/uQ+SEA5LmvNqwkAVTAU7B8xGv2mORBZfH6MuVQzAZ9CIQe9qd6YV8YDM ZVS814OqePonjtJyEe3LU19wxJRAd6/svh/wXeUR5Tyl8eqpJNUqqQ5L2ea6PxzRFagH bIJ7aDXHhjfFPikqzc9gr5+UCbm041igON9AdDGVDrcV0LurZ6K2sB8875WC4Ju5q3O3 3w2MPhHPjnd4XQ60MLI9A3UT9PIzBXkCwYedfuOxVYricG1294a3XQ8PNuWAIcgVX4Ad KYVumcc1bXwMUkWScsuRhSm84xjrd1bpF66xuvTgRJWVgi9s56JIeNy/h4TOG0uVP10z e3ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e1JvkQ93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x8-20020a1709027c0800b0015d1ef2dd92si1316773pll.47.2022.05.17.21.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e1JvkQ93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 222C6BE0F; Tue, 17 May 2022 20:41:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351540AbiEQRmX (ORCPT + 99 others); Tue, 17 May 2022 13:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242639AbiEQRmV (ORCPT ); Tue, 17 May 2022 13:42:21 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FE45D128 for ; Tue, 17 May 2022 10:42:20 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-f1d2ea701dso1067531fac.10 for ; Tue, 17 May 2022 10:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eg7EH5Vrvb2fKjVFmkcCg9Zq9x2kct9i+zNiZ3Rb9nE=; b=e1JvkQ93rAtCK7sn488U3SuJf4AoUESglxHXrKJTTMMkNeQNcU7i/nTgft7PxtzV81 JTZb2e0ArclXtYmdxk/G5BmXdnm+y8WTIxYFtmcmGcWKgMQy1d7RhscLPElAzT1nXsHj Xd2uFtRkYUUKQb5Cxhh1Wdfsp9NSTDDMoVQRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eg7EH5Vrvb2fKjVFmkcCg9Zq9x2kct9i+zNiZ3Rb9nE=; b=y42rDLssUbag7VD0I2mGt2mEOTdSuEwSuWv2rjNgD7AgoIYfjyd3TkQsHs7hBNcqh6 3dQs29TA8pxKb7Eh2hLBbXG3JgXco//0Gr20YtIi4totMlYmJHH9gw4ynwkTppu2eHY/ NJ6heHxVlLmQZ7lpfdODzEyOm3jYgt8mvwCe/UX5qj51XXFarXJuzT4SdvNP1uKBzXKK 72mjS5WAROKJABjvjzwr85Sskf/rsiaVMvyy1Eg9S08W7ADiNXhLYps1WvWfaJb4z1hG l+H0LLmNQI/WPMoNNoVtMEl4Zcv8O8102zBHUALJeRtZfJDwMMgvPd+Provwf1eNUj+o 4r7g== X-Gm-Message-State: AOAM530F1/4l0NELVCOjs2O9hpqPQZE/7Q3XHjxZQbD1fJrrleVSfXp/ TKs1aNixAXPs0mmCVaEB7lpU+y+CF33WJw== X-Received: by 2002:a05:6870:2053:b0:e9:3c2f:23d9 with SMTP id l19-20020a056870205300b000e93c2f23d9mr18943081oad.158.1652809339364; Tue, 17 May 2022 10:42:19 -0700 (PDT) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com. [209.85.167.179]) by smtp.gmail.com with ESMTPSA id i10-20020acaea0a000000b00328e70cae5csm42389oih.43.2022.05.17.10.42.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 10:42:18 -0700 (PDT) Received: by mail-oi1-f179.google.com with SMTP id j12so23188877oie.1 for ; Tue, 17 May 2022 10:42:18 -0700 (PDT) X-Received: by 2002:a05:6808:d52:b0:328:acfc:d274 with SMTP id w18-20020a0568080d5200b00328acfcd274mr11183218oik.174.1652808882898; Tue, 17 May 2022 10:34:42 -0700 (PDT) MIME-Version: 1.0 References: <20220504232102.469959-1-evgreen@chromium.org> <20220506160807.GA1060@bug> In-Reply-To: From: Evan Green Date: Tue, 17 May 2022 10:34:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 00/10] Encrypted Hibernation To: "Rafael J. Wysocki" Cc: Pavel Machek , LKML , Matthew Garrett , Daniil Lunev , zohar@linux.ibm.com, "James E.J. Bottomley" , linux-integrity@vger.kernel.org, Jonathan Corbet , "Rafael J. Wysocki" , Gwendal Grignou , Jarkko Sakkinen , Linux PM , David Howells , Hao Wu , James Morris , Jason Gunthorpe , Len Brown , Matthew Garrett , Peter Huewe , "Serge E. Hallyn" , axelj , keyrings@vger.kernel.org, "open list:DOCUMENTATION" , linux-security-module@vger.kernel.org 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,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Rafael, On Tue, May 17, 2022 at 9:06 AM Rafael J. Wysocki wrote: > > On Mon, May 9, 2022 at 6:44 PM Evan Green wrote: > > > > On Fri, May 6, 2022 at 9:08 AM Pavel Machek wrote: > > > > > > Hi! > > > > > > > We are exploring enabling hibernation in some new scenarios. However, > > > > our security team has a few requirements, listed below: > > > > 1. The hibernate image must be encrypted with protection derived from > > > > both the platform (eg TPM) and user authentication data (eg > > > > password). > > > > 2. Hibernation must not be a vector by which a malicious userspace can > > > > escalate to the kernel. > > > > > > Can you (or your security team) explain why requirement 2. is needed? > > > > > > On normal systems, trusted userspace handles kernel upgrades (for example), > > > so it can escalate to kernel priviledges. > > > > > > > Our systems are a little more sealed up than a normal distro, we use > > Verified Boot [1]. To summarize, RO firmware with an embedded public > > key verifies that the kernel+commandline was signed by Google. The > > commandline includes the root hash of the rootfs as well (where the > > modules live). So when an update is applied (A/B style, including the > > whole rootfs), assuming the RO firmware stayed RO (which requires > > physical measures to defeat), we can guarantee that the kernel, > > commandline, and rootfs have not been tampered with. > > > > Verified boot gives us confidence that on each boot, we're at least > > starting from known code. This makes it more challenging for an > > attacker to persist an exploit across reboot. With the kernel and > > modules verified, we try to make it non-trivial for someone who does > > manage to gain root execution once from escalating to kernel > > execution. Hibernation would be one obvious escalation route, so we're > > hoping to find a way to enable it without handing out that easy > > primitive. > > > > [1] https://www.chromium.org/chromium-os/chromiumos-design-docs/verified-boot/ > > So I guess this really is an RFC. Yes, I suppose it is. > > Honestly, I need more time to go through this and there are pieces of > it that need to be looked at other people (like the TPM-related > changes). No problem, thanks for the reply to let me know. I expect some back and forth in terms of what should be hidden behind abstractions and where exactly things should live. But I wanted to get this out to upstream as early as I could, just to get initial reactions on the overall concept and design. Looking forward to hearing your thoughts when you get a chance, and let me know if there are others I should be adding that I've missed. -Evan > > Thanks!