Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3901728pxb; Mon, 8 Feb 2021 03:05:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxljtlNrXGCjTfqxbkkDTFZtmniIdl8j6H95EmOR2PNCEROqJN1GFWWXfUW/uEaGHkMRQpb X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr16105055ejb.123.1612782346403; Mon, 08 Feb 2021 03:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612782346; cv=none; d=google.com; s=arc-20160816; b=xGMVQxgVPW1nML3VuTksvAKcvIeHXJKMAbWmyHmJaQr7B4nO7+r+Q4vxNPI1ta32Gb /ZyShjvzQta3WeLX++vndOQ5mRq1Z8vU9p7/JUOAeDjfc5hJSnSHqKdHGufUFk5cehDC ww+6wKyeI2V7KThpozZ0F1xK8lYDS1jflGv+c6EmFSUeWecffB4RLcIDLq6aVMmGOvX8 hHRhjPiPqvv+Y+U2oXwhgz98LQ1Wkep3mYWD/CQog6q+blLU0N3nJDIKDzglXiy5u8F2 4X9+5yDK8Abhd63Z/32E03zfJzRfcOpgTniNxjqK1yZbI3DKFg97rHXz7w1bdXPFqD5R Wz2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZIZtK7KGQOpq2x4SzJLMBFITOVmfiRO9HVwMLT9AWfk=; b=V44v8Je1Y0ug3RmckBm2stprRsprdi6y9uEFBLtHKF5TkBDcNcSEHXO+r6zfp40qKi i5En+Gmri4jYhcyrIeqRbT3qB/9BqfXao8o9sicQSVBwcF2AvsGvCj00h3D+kqcb8N/a nFikKiYMHY5ggZMm5r1CZ5OY+bnxB32q55vgsFy49olFr6B6X2+VPKHZIhu7Z62W3C1+ RNcJxf3IzC1w9fMiet//ZDajJmgnZaRP5N/66tLQaF0Pj2tsLockEInaJkQNHj8Ow5sa jvZfCIvfinJzv2KCbNdEj1l52TRJMKnBFPzsfGKDtgED7x9yRlowEAKhf3vH9Q31JnHQ O72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=WpbjzGZc; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si12453915ejb.47.2021.02.08.03.05.22; Mon, 08 Feb 2021 03:05:46 -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=@suse.com header.s=susede1 header.b=WpbjzGZc; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233046AbhBHLEL (ORCPT + 99 others); Mon, 8 Feb 2021 06:04:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:56190 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232773AbhBHK5w (ORCPT ); Mon, 8 Feb 2021 05:57:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1612781826; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZIZtK7KGQOpq2x4SzJLMBFITOVmfiRO9HVwMLT9AWfk=; b=WpbjzGZc+3/YkHH1uGy0eGbUYo8oCacDxNQEQtRXANwZxHwtylTb3HKk6I403Q7833wHJ8 aLnM/cCkpwLJswRwURhqmjTvVUu01dIEr0vSyMIJGgoFeM+JOYdLAc7kCdZvfbthq/oS41 xyqZWWQ3VtQBnKDUYpZPwfTqaSytqRw= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E729BAC6E; Mon, 8 Feb 2021 10:57:05 +0000 (UTC) Date: Mon, 8 Feb 2021 11:57:05 +0100 From: Michal Hocko To: David Hildenbrand 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 Subject: Re: [PATCH v17 08/10] PM: hibernate: disable when there are active secretmem users Message-ID: References: <20210208084920.2884-1-rppt@kernel.org> <20210208084920.2884-9-rppt@kernel.org> <38c0cad4-ac55-28e4-81c6-4e0414f0620a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Michal Hocko SUSE Labs