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 1657FC433F5 for ; Tue, 17 May 2022 17:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351447AbiEQRe6 (ORCPT ); Tue, 17 May 2022 13:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbiEQRe5 (ORCPT ); Tue, 17 May 2022 13:34:57 -0400 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CC6B3A18E for ; Tue, 17 May 2022 10:34:56 -0700 (PDT) Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-d39f741ba0so25027126fac.13 for ; Tue, 17 May 2022 10:34:56 -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=WyoarFEtsXNoYtJTu1ERCeZZB74SsV0yomCryVTD93MasKlMNOLtOoIsHeyiPYSTFT LsjYi2GAKHjcsS2E/UPURQKeVBxjEeDODgG5mUDMvK9zUJTUTLXcULzyiY/XD4zhCX8S rxayYEzGoFFM2UVVY2Iyk6cCocefhvaWs3UPX3YM+PIdwr37Z+n3vrtM+YgCd1yKmdua LyJfPq8B/W1udkThkFKUoP85liJtbMLnD1tGcjkVZF4M1EmWYFll14vAPEonhnw+GxQ4 /AgBR00IfKlB4+H63vWWeRUzkzmbH89VFkfuQH1J1/upkhJ0JXNzVOzEVPgqkwJ8zGoc 7VpA== X-Gm-Message-State: AOAM532YH+z/BjhdCNQn5LpqS1r/Ka87nxDOktTexu7zG8X6h3zfXOgR yKT+Ca3au0X+sUKRl6v9ujAnrhseAWUOqg== X-Google-Smtp-Source: ABdhPJzapnBIub8hhvSK2aXx17sXTASMZUlcWWA0Gf/3tbx3bofRcJcM31rT3cAIEMq5zuKzlg2m1A== X-Received: by 2002:a05:6870:e890:b0:f1:8580:6f4c with SMTP id q16-20020a056870e89000b000f185806f4cmr9162996oan.30.1652808895361; Tue, 17 May 2022 10:34:55 -0700 (PDT) Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com. [209.85.160.49]) by smtp.gmail.com with ESMTPSA id s38-20020a05687024a600b000e686d13871sm18670oaq.11.2022.05.17.10.34.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 10:34:54 -0700 (PDT) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-d6e29fb3d7so25048132fac.7 for ; Tue, 17 May 2022 10:34:54 -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: 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!