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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 757D5C43468 for ; Mon, 13 Jul 2020 08:02:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 410772072D for ; Mon, 13 Jul 2020 08:02:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 410772072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B3CBD8D0008; Mon, 13 Jul 2020 04:02:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC7108D0002; Mon, 13 Jul 2020 04:02:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98EA48D0008; Mon, 13 Jul 2020 04:02:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 832B18D0002 for ; Mon, 13 Jul 2020 04:02:10 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 391E4180AD822 for ; Mon, 13 Jul 2020 08:02:10 +0000 (UTC) X-FDA: 77032309620.04.push60_5e0bd2126ee6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 049498003F85 for ; Mon, 13 Jul 2020 08:02:09 +0000 (UTC) X-HE-Tag: push60_5e0bd2126ee6 X-Filterd-Recvd-Size: 4345 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jul 2020 08:02:09 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id e22so12252889edq.8 for ; Mon, 13 Jul 2020 01:02:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QIHoei67Z3/KR3sFEx7o/EA6f6Nm5nK1Sv4SUBIKxAE=; b=bKCvbSXc24mSaub5ooFXtO9CYyjXasqkKRerUdM+DBgzCL8MNqAV9MfQ1ANqjj3oAK ZLGEZV8vpFyttLSpeBZvDUMDwSTr6QWxXWf0ly0WaV0lfRSzk+qAOwLyMZmqfyUUBPd1 rVWUovIg0sNKZsSyMz94wxg1zlEVWtQuMkwEE3KJybML9xwEyoFg7UKN1Shg0/BuXLmv J//h+ifwemdsrk2Bda+k2m8mWnAeoIeMlUUMpD4vL+yo+ZRbys1K6J+MfBzPPvKQIr39 U5zJpCn6oVyzx6xxMKlP8g9bNKXORC8bi1ycqJpPIpPGBpvex3raAsrhv/NdQLH6enih QaJQ== X-Gm-Message-State: AOAM530XJ6IlU8yp03qiuMtLD1C/Ilm0BZW53GeZYAmRbRrCnJbPCQkx 4GaVCnRceKlT5v9TQpFBOS0= X-Google-Smtp-Source: ABdhPJwWvN1QcpCsa31iIwBgYb5oydvR6pwx8KYoNceT/279HJ9gdKt0l1YifwXe/09Udr1Sulcp2A== X-Received: by 2002:a05:6402:1c07:: with SMTP id ck7mr78270857edb.297.1594627328559; Mon, 13 Jul 2020 01:02:08 -0700 (PDT) Received: from localhost (ip-37-188-148-171.eurotel.cz. [37.188.148.171]) by smtp.gmail.com with ESMTPSA id cw19sm9155356ejb.39.2020.07.13.01.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 01:02:07 -0700 (PDT) Date: Mon, 13 Jul 2020 10:02:06 +0200 From: Michal Hocko To: Pavel Machek Cc: Colm MacCarthaigh , Jann Horn , "Catangiu, Adrian Costin" , linux-mm@kvack.org, linux-pm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-api@vger.kernel.org, akpm@linux-foundation.org, rjw@rjwysocki.net, len.brown@intel.com, fweimer@redhat.com, keescook@chromium.org, luto@amacapital.net, wad@chromium.org, mingo@kernel.org, bonzini@gnu.org, "Graf (AWS), Alexander" , "Singh, Balbir" , "Sandu, Andrei" , "Brooker, Marc" , "Weiss, Radu" , "Manwaring, Derek" Subject: Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND Message-ID: <20200713080206.GD16783@dhcp22.suse.cz> References: <20200703113026.GT18446@dhcp22.suse.cz> <20200707073823.GA3820@dhcp22.suse.cz> <20200707080726.GA32357@amd> <20200707085847.GA5913@dhcp22.suse.cz> <20200707163758.GA1947@amd> <20200712072228.GB4721@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200712072228.GB4721@duo.ucw.cz> X-Rspamd-Queue-Id: 049498003F85 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun 12-07-20 09:22:28, Pavel Machek wrote: > On Tue 2020-07-07 12:00:41, Colm MacCarthaigh wrote: > > > > > > On 7 Jul 2020, at 9:37, Pavel Machek wrote: > > > Please go through the thread and try to understand it. > > > > > > You'd need syscalls per get_randomness(), not per migration. > > > > I think one check per get_randomness() is sufficient, though putting it at > > the end of the critical section rather than the beginning helps. > > Yeah, well, one syscall is still enough to make it useless. I am sorry but I really do not follow. Why would you want to call a syscall on each get_randomness invocation? Why is it not enough to simply have a flag that tells that an external event has happened and reinitialize if the flag is set? Yes this wouldn't be really sync operation but does that matter? Is using a few random numbers from the old pool just because the notifier hasn't processed and flag the situation a major security concern? Btw. let me just clarify that I am not by any means pushing a solution like that. All I am saying is that MADV_WIPEONSUSPEND is inherently subtle interface that we likely want to avoid. -- Michal Hocko SUSE Labs