Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5158914iob; Mon, 9 May 2022 09:49:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe8dcB8ci3CE7lKEJeYGhmN9cPz80YjkM77yV+XnGov3xlyXsS+uUobGl5Jm7oV2HqxJFv X-Received: by 2002:ad4:5e89:0:b0:45a:d9c8:e04b with SMTP id jl9-20020ad45e89000000b0045ad9c8e04bmr14107825qvb.112.1652114997094; Mon, 09 May 2022 09:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652114997; cv=none; d=google.com; s=arc-20160816; b=z29qNjc7aNbcyYrEfupNJeJ+zWgeTGxsQZzDorozanIJF5mVX1CXWEqmPrMudAJUBh KnKpGjDfIRF6g2eodPnCXtHzujIIe/Q6S1AthwEME2wx0MRK0yNpzungAt5iYAgF+RlB iIN95R/cEY+IQqA1Z9QEbv9tTb1y0jxIKR007gdyWMEfQkxo/9gl3wyuM9NB8vETlF7D AJgkU3EFjlrj5M9C8+69IGGtTCKoGDVXV/rQfFRv/e5IVfOJT1kNbYrxv3YWL8iZltkG f1XOVqEuRbIA6MVxvsXruj7Yn6UQI3saNdmJCRrvyDFhcCM2+EEDine1JEPD27dyb3vy 32HA== 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=XqWCEiFRZR6d7K91PH8ezSoYLh3BKRbhvIoPlxx9A7I=; b=kNGPkbh9Y6jmthqjtpuyDwvSBptl1PLXRC2caP9+rMDB1AIHUk91a8grjTTRPbXC2x gRYm1Yr48lVyHYvF8a7Gzrf2ksOhJ0Bm2YC9Dku5gAg4AeW+al981ikmD52YsqTGwegi zGHfdWlihipCdIO3xrbdgbV5WkbeQeuD7ArIJbHaShbGRTwjsRH92LPfC/A4vZ8lcK4e 1subEH1F8yDqQnfofjA+5uDvbbi/Tg0f2CRUj+QgSNg9oB4gwxunLr/Vzr5dIA1qJInQ Re1VKIR+91hr0hoyF3v2mIYrRDaXz87J80fCs13Lwn9IBqJIl9hpYefMahDrwg6eULST E4xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HUq4PANp; 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 q19-20020a05622a04d300b002f1f87c53d6si8267499qtx.118.2022.05.09.09.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 09:49:57 -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=HUq4PANp; 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 079202016D1; Mon, 9 May 2022 09:44:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239266AbiEIQr4 (ORCPT + 99 others); Mon, 9 May 2022 12:47:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239215AbiEIQry (ORCPT ); Mon, 9 May 2022 12:47:54 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345061F2D71 for ; Mon, 9 May 2022 09:43:59 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-ed9ac77cbbso15375403fac.1 for ; Mon, 09 May 2022 09:43:59 -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=XqWCEiFRZR6d7K91PH8ezSoYLh3BKRbhvIoPlxx9A7I=; b=HUq4PANpxSIB27eIQbGcBLcJ1kMRfgia2LIbn1U/sr3tsZ29aWkap3rwOThAhgUyct MW4AAxZzt0kalHcKw0VYco7ySwx5B0Q6L9DvBsfj/UbG57AwzHEN8a6JkyYUfNQ29VTC pohnxIWc1viOIWSeXqW8vA+HehX4XegFte3mA= 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=XqWCEiFRZR6d7K91PH8ezSoYLh3BKRbhvIoPlxx9A7I=; b=DGgJc7a0l3RvToATzOCyCyLINwbIzIAv0lyldLRT8us6XAQSdJUJ1rh/OzMdnG0IUi ryUB6S9LWWTTHZZ+7J+wt//Y1SFkZov7K0/YqyBGVbLfqwy0PovIwwj8/Al0osDxVB8H AcoZU25RYljNOoUi+KZ6M/zlma/IvGXYdPA9+pR+VyuXtT1VlO0+7tOSAuoN517zorl/ PIaeQEbjAJYTM1nNyzs9Yc+bm1mIRLpP7Z1Ndf4Jl+omJmJaqbh25+wYM+1Grn6jE77P MdFztvGffPgKMeGKa1dDnf5ajUrhF+2zO+/KtStdtvFhZ1fVApz4+kU2WYnBBK1J40+m 0GhQ== X-Gm-Message-State: AOAM531o4LT97X75tMi2ddwVTpSzc/hvtvaqzyCXfxb8RinB0nFe7APW 8F397lNFSFm6qXS/H8GCg8AeMUKOc8u/U3al X-Received: by 2002:a05:6871:6a7:b0:ec:6a95:408b with SMTP id l39-20020a05687106a700b000ec6a95408bmr9900700oao.127.1652114638422; Mon, 09 May 2022 09:43:58 -0700 (PDT) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com. [209.85.210.53]) by smtp.gmail.com with ESMTPSA id o34-20020a056870912200b000ee2bb503d0sm3359251oae.50.2022.05.09.09.43.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 May 2022 09:43:57 -0700 (PDT) Received: by mail-ot1-f53.google.com with SMTP id k25-20020a056830169900b00605f215e55dso10491488otr.13 for ; Mon, 09 May 2022 09:43:56 -0700 (PDT) X-Received: by 2002:a9d:6953:0:b0:606:3534:168e with SMTP id p19-20020a9d6953000000b006063534168emr6192989oto.237.1652114636260; Mon, 09 May 2022 09:43:56 -0700 (PDT) MIME-Version: 1.0 References: <20220504232102.469959-1-evgreen@chromium.org> <20220506160807.GA1060@bug> In-Reply-To: <20220506160807.GA1060@bug> From: Evan Green Date: Mon, 9 May 2022 09:43:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 00/10] Encrypted Hibernation To: Pavel Machek Cc: LKML , Matthew Garrett , Daniil Lunev , zohar@linux.ibm.com, "James E.J. Bottomley" , linux-integrity@vger.kernel.org, Jonathan Corbet , rjw@rjwysocki.net, 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, linux-doc@vger.kernel.org, linux-security-module@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 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=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 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/ > Best regards, > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html