Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3920004pxb; Mon, 8 Feb 2021 03:36:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPCOWPTx4EJ+d1zQK3JcwotXPr59Rrehhj1WYMnXOF/12HlYcQO1ffj8//7T66zJIJYhHM X-Received: by 2002:aa7:dd49:: with SMTP id o9mr16553067edw.14.1612784173936; Mon, 08 Feb 2021 03:36:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612784173; cv=none; d=google.com; s=arc-20160816; b=KTgMLz1pF7G6BJJL3n++fX8nRu1TWtCV5wq2Rj3bB+FsqfWh0tSJ/uM0r2PldOi3Dj CA1GwgIMdlThQEoLCJaY4UlLEWOOWDW2u5FhZwZn1Flt4FJKMf2/YSADRE0ho9oyWFwk eKIwYzzh+ezVFuoIZAoxPq/XnKmvvHgGJu3u9HAeHjE/cSqsDBUC+0UGu2U4yTie8Lp8 EbHCGg0T3RZdl3eIkEtOidrNrW+uy+M5i6Ys2N5OLa7mx7OWm5Q7R+4YwvlQa7ZN0f0J v7W+FisqSqh+RPz7Vj2E7ZPpCuI2Ctmuj6Qzh8VBH04lBrfI80v4fLiB+ReM4vDTOabG POhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :references:cc:to:from:subject:dkim-signature; bh=iMMAZUkyH+ZKGo/5ngkXcKGY7DpWIxntZe8dxLbr64A=; b=Of867fxTtuioIWOy7+xNvnW+YDBR/ZTI5aJhfTiyeSP72yRtq2vduWuor+6jLxgNGL 4BdTx5mZDI49a3Zl1Ij2Ua1x1N2OJwWZvLWFw8AOuTFqgt9iffMqY7ixnrk7AdbmWHx0 wkeukN4DPQCUb6F9qNlwCZW4+T7GC1g5lr6g1sjDPJ3Qe5Lt0LLniD/R8KHl0DnZT328 xwYNs1EDyJ2qnfbeYC8oQXlgu5xttUEeJS+Rg271Xrz0hPCXNg+cc4nKkVIlqTfHOuXm yyq9khSeBVqoYh3z6LUGNG42mm7rV/T8VCExZ2rsREmgfhy0lIytq7yfkb6Gieqjfllj J75w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eoLYIMD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch3si9712117ejb.650.2021.02.08.03.35.49; Mon, 08 Feb 2021 03:36:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eoLYIMD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233383AbhBHLcw (ORCPT + 99 others); Mon, 8 Feb 2021 06:32:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47074 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233017AbhBHLQX (ORCPT ); Mon, 8 Feb 2021 06:16:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612782897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMMAZUkyH+ZKGo/5ngkXcKGY7DpWIxntZe8dxLbr64A=; b=eoLYIMD8SorQivSRX48jD8x51UI710nCugbiHoa2jkXONC/vEMmbKxE6WviH1GCsRQ4CWt ijNcCPoYXA2KGz55cwPEkLzalTj+xcqidnOus0sy2JsTJ3L0c2utkmKVBZoko1hiSzoLUC yKUbyHmJLTRR0NM1Ytb8QtC2S15mMks= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-GXyOZsouM8ig9OB-3XPXHQ-1; Mon, 08 Feb 2021 06:14:53 -0500 X-MC-Unique: GXyOZsouM8ig9OB-3XPXHQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15D6B80196E; Mon, 8 Feb 2021 11:14:49 +0000 (UTC) Received: from [10.36.113.240] (ovpn-113-240.ams2.redhat.com [10.36.113.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DCA95C1D0; Mon, 8 Feb 2021 11:14:41 +0000 (UTC) Subject: Re: [PATCH v17 08/10] PM: hibernate: disable when there are active secretmem users From: David Hildenbrand To: Michal Hocko Cc: Mike Rapoport , Andrew Morton , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Hagen Paul Pfeifer , Palmer Dabbelt References: <20210208084920.2884-1-rppt@kernel.org> <20210208084920.2884-9-rppt@kernel.org> <38c0cad4-ac55-28e4-81c6-4e0414f0620a@redhat.com> <770690dc-634a-78dd-0772-3aba1a3beba8@redhat.com> Organization: Red Hat GmbH Message-ID: <21f4e742-1aab-f8ba-f0e7-40faa6d6c0bb@redhat.com> Date: Mon, 8 Feb 2021 12:14:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <770690dc-634a-78dd-0772-3aba1a3beba8@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.02.21 12:13, David Hildenbrand wrote: > On 08.02.21 11:57, Michal Hocko wrote: >> On Mon 08-02-21 11:53:58, David Hildenbrand wrote: >>> On 08.02.21 11:51, Michal Hocko wrote: >>>> On Mon 08-02-21 11:32:11, David Hildenbrand wrote: >>>>> On 08.02.21 11:18, Michal Hocko wrote: >>>>>> On Mon 08-02-21 10:49:18, Mike Rapoport wrote: >>>>>>> From: Mike Rapoport >>>>>>> >>>>>>> It is unsafe to allow saving of secretmem areas to the hibernation >>>>>>> snapshot as they would be visible after the resume and this essentially >>>>>>> will defeat the purpose of secret memory mappings. >>>>>>> >>>>>>> Prevent hibernation whenever there are active secret memory users. >>>>>> >>>>>> Does this feature need any special handling? As it is effectivelly >>>>>> unevictable memory then it should behave the same as other mlock, ramfs >>>>>> which should already disable hibernation as those cannot be swapped out, >>>>>> no? >>>>>> >>>>> >>>>> Why should unevictable memory not go to swap when hibernating? We're merely >>>>> dumping all of our system RAM (including any unmovable allocations) to swap >>>>> storage and the system is essentially completely halted. >>>>> >>>> My understanding is that mlock is never really made visible via swap >>>> storage. >>> >>> "Using swap storage for hibernation" and "swapping at runtime" are two >>> different things. I might be wrong, though. >> >> Well, mlock is certainly used to keep sensitive information, not only to >> protect from major/minor faults. >> > > I think you're right in theory, the man page mentions "Cryptographic > security software often handles critical bytes like passwords or secret > keys as data structures" ... > > however, I am not aware of any such swap handling and wasn't able to > spot it quickly. Let me take a closer look. s/swap/hibernate/ -- Thanks, David / dhildenb