Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp129969iob; Tue, 17 May 2022 21:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzVWqJ1SieF2307t3NJmqjSfJl/Zz8ryRQFpZUbb8tWaMyp+Yp+X/9y7ZQ7LwYyqnExPyA X-Received: by 2002:a17:90a:2f84:b0:1dd:940:50e7 with SMTP id t4-20020a17090a2f8400b001dd094050e7mr39075340pjd.210.1652847255653; Tue, 17 May 2022 21:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652847255; cv=none; d=google.com; s=arc-20160816; b=n1luYOmL4JyYBVrXN3RX9m9FYQ8k/kVBwIonhHvl/zq4gz+RSTcBldG1XagQ+d872O tSIuxgzvbJV+St8AAwvjzJzJIwoZsVSg8wUnkA+MfzF4gM/qzpNjEuTovoUldlDAxnqF 0K9HKemtHTxEQvs2YzCBTXxra3PwBRBg0nT8Vw5NR4Wtnarq5YxfxM87fz5kc8tG6iZe zo72oazDyrI6AlwY7BzpaCKpTgEl9me9ZrRcH2FgoFmM/EKCP5m1F/cuKdJb9+Ofd5rz lR28fi2DC0g7uEtsvMRMlEvAexinqabeQRb5vSOGUmjzyxORgh2T7RRPOTOnl6O0n7MM hRgQ== 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; bh=T+Y0T0by6V75JyhkkKhy6aaHysUDsmwlgU76NEv5hWY=; b=txxfcEemNa+y7qHX686ZHMoRhQW8DUu4ZxlXusaZRUe7wZ8byX/rFW8GZW/57qd7vo fvAE4gH3+AkhOXafGyrQrCNY9vH6Hdzhm16ExVRj+thPHm+sZGQiH3dHQYa376pNFO+H xzCxxCBnHpvGaiiuK4VMMMdSvYfQ0v0plJ1FWLOFG7Gr/5U8qKWnDkOtOoRQ+DZUdheK Fht5F4gzEn7RzWiEZcLOK8qNDkZWxGdwrXUUsQVtyHA1fxMCKxIRahJnrIjeyL6dT8Ym P0m6Ui8g51Qrmd/BHPd+KDABXVLXSaknk5T9hq/2wC9YVpT6lD9LcmV3LpjnMtdkWAEm KTwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d19-20020a056a0024d300b004fa8832da6dsi1922662pfv.76.2022.05.17.21.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:14:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 199395F26A; Tue, 17 May 2022 20:43:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350787AbiEQQHA (ORCPT + 99 others); Tue, 17 May 2022 12:07:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350676AbiEQQG5 (ORCPT ); Tue, 17 May 2022 12:06:57 -0400 Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A63369E5; Tue, 17 May 2022 09:06:56 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id i11so33157487ybq.9; Tue, 17 May 2022 09:06:56 -0700 (PDT) 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=T+Y0T0by6V75JyhkkKhy6aaHysUDsmwlgU76NEv5hWY=; b=JTxWjsc1g9aYb/foqfiAq6EqRuWOzjuVWT97j4hei0KotI2fGZLoyk5H9k2vpFVABK 2gMsAP0otZsp+mk4lMAGh5XYJwdaXjJoz80VaExDriCUo+A3xY8XODKIDdwx5p18pPUQ a79VdvzuaLIqj7ePYQqWL3ltFlobmmcsUXkTK16aBZNP/jNyitdFGU1TkiZDemdu5EsA 8Fi83f/O6anK8/sqbNSQwnkPiUtuJCD7cQPLa7QkjqinCLfNzWPo9z3j5A7g3ADyELE4 9S2kwN74Xkh074fXE7Mzs60WyKzUKTnfuGprrBd12erZl9WIBPz4akLvqw3XGoYMz2LX 5cXA== X-Gm-Message-State: AOAM5304AGrVtug+HToZCE+wR33fjbyUtDZYx3YvC6ghQNl6CkbNe1AC KpDRUclLkwOy0fMtVPDqu2oZVjTI/cKT/WlHqws/ufhe X-Received: by 2002:a25:1145:0:b0:64d:d6be:c741 with SMTP id 66-20020a251145000000b0064dd6bec741mr8135761ybr.137.1652803615502; Tue, 17 May 2022 09:06:55 -0700 (PDT) MIME-Version: 1.0 References: <20220504232102.469959-1-evgreen@chromium.org> <20220506160807.GA1060@bug> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 17 May 2022 18:06:44 +0200 Message-ID: Subject: Re: [PATCH 00/10] Encrypted Hibernation To: Evan Green 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 , "Rafael J. Wysocki" , "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,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 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. 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). Thanks!