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 DB17AC433FE for ; Fri, 6 May 2022 16:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443654AbiEFQM4 (ORCPT ); Fri, 6 May 2022 12:12:56 -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) Precedence: bulk List-ID: X-Mailing-List: linux-integrity@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