From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F25B5C433EF for ; Tue, 17 May 2022 17:42:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351555AbiEQRmY (ORCPT ); Tue, 17 May 2022 13:42:24 -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-Google-Smtp-Source: ABdhPJwG8nRhvgI3W3FvY8JhBMDKh/vmTRfPNtrQFd2+D9mVFgIkrYE7TIfZVm9LReOVStGuql5sow== 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" 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!