Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4811722iob; Mon, 9 May 2022 02:07:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK6qarT3c83aNFBGixW/wH/RruRGoUaj5OBCvyDpDD+7FNqoik7+TyENVt0X4O6mg4Ic7k X-Received: by 2002:a05:6a00:9a2:b0:505:974f:9fd6 with SMTP id u34-20020a056a0009a200b00505974f9fd6mr15049995pfg.12.1652087256279; Mon, 09 May 2022 02:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652087256; cv=none; d=google.com; s=arc-20160816; b=cR9I9tWov/wjspzesnMry1BrTQU4urohxGXzfzMIsRMOK+0kG+1WkZCEY/b4ZmTQla 6MR9KFtd9IzdYeW738Ib7Ldq9ln35eHNashNAnfNmeaGTjfxOZG8CjOzC3S5XQPaRQOx BLaeOM1VyXuQ/PacFwxJXwtUNlsZCyJL+irC1gxhCn1LlwYM+pkEGdCkZ5l0tvPOFwqu d9mFABZoGiZ6AbUWB7n+lMJUurNwXb+xU1RfFrN2O6AIe2WCwxHnKgwWKcLFj4Vt/iL7 yrEN8A4JrRdJeEIwDs5hU5a/Onzl1olEijkOIuUONwOrQvPAzGIIgr+HWAjIu/Lm26Q8 d8SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SCwlGM5y1Ny9XLcdI8TaL4Zxb8H8B41cl6G7pm/JVXM=; b=UILrhHnd9vU83d+ZdOT02oj/7MlCt6+IvtKjLfMEuZF9qdN5gjp4IRvBLA80l5gZy7 QoW+WHgntOubbhNS0yrkbMqLMSbjV7OODbCObqhotJOEbtVqJVz8VZtCkXbG66Qhj4Jm GTLuqcXnpoWyRhxl9JO1K8DrnbIuyF5hiGGhiDE+27O3jBIeI84hK9tSX2wMrA/KfA5D tt/khlgeJgd1bCPg/TxV8jFLeN7s5M2NDVlbTbG6ILr4NsjiN6Ph6WqVZmQ5ZsLT5UFp fvAjw0xOv2RCeM2vFsaL9q+nE58WYSQLpG/xDUbwVXiIt2CMcGOTSXOn+x6qyU9mAHbc qqVg== 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j3-20020a625503000000b0050de30e03e5si13160866pfb.291.2022.05.09.02.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:07:36 -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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D8F9C202B18; Mon, 9 May 2022 01:53:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443554AbiEFQM7 (ORCPT + 99 others); Fri, 6 May 2022 12:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443558AbiEFQMt (ORCPT ); Fri, 6 May 2022 12:12:49 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6840F6EC53; Fri, 6 May 2022 09:08:23 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 2CEDD1C0BCD; Fri, 6 May 2022 18:08:22 +0200 (CEST) Date: Fri, 6 May 2022 18:08:20 +0200 From: Pavel Machek To: Evan Green Cc: linux-kernel@vger.kernel.org, Matthew Garrett , dlunev@google.com, zohar@linux.ibm.com, jejb@linux.ibm.com, linux-integrity@vger.kernel.org, corbet@lwn.net, rjw@rjwysocki.net, gwendal@chromium.org, jarkko@kernel.org, linux-pm@vger.kernel.org, Len Brown , "Rafael J. Wysocki" Subject: Re: [PATCH 08/10] PM: hibernate: Mix user key in encrypted hibernate Message-ID: <20220506160820.GB1060@bug> References: <20220504232102.469959-1-evgreen@chromium.org> <20220504161439.8.I87952411cf83f2199ff7a4cc8c828d357b8c8ce3@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220504161439.8.I87952411cf83f2199ff7a4cc8c828d357b8c8ce3@changeid> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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! > One annoyance of the "preloading" scheme is that hibernate image memory > is effectively double-allocated: first by the usermode process pulling > encrypted contents off of disk and holding it, and second by the kernel > in its giant allocation in prepare_image(). An interesting future > optimization would be to allow the kernel to accept and store encrypted > page data before the user key is available. This would remove the > double allocation problem, as usermode could push the encrypted pages > loaded from disk immediately without storing them. The kernel could defer > decryption of the data until the user key is available, while still > knowing the correct page locations to store the encrypted data in. Um. Dunno. Won't you run out of memory? Hibernation images can be quite big... Best regards, Pavel