Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752417AbdHHQsU (ORCPT ); Tue, 8 Aug 2017 12:48:20 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:35520 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbdHHQsS (ORCPT ); Tue, 8 Aug 2017 12:48:18 -0400 MIME-Version: 1.0 In-Reply-To: <1502207168.6577.25.camel@redhat.com> References: <20170806140425.20937-1-riel@redhat.com> <1502198148.6577.18.camel@redhat.com> <0324df31-717d-32c1-95ef-351c5b23105f@oracle.com> <1502207168.6577.25.camel@redhat.com> From: =?UTF-8?Q?Colm_MacC=C3=A1rthaigh?= Date: Tue, 8 Aug 2017 18:48:17 +0200 Message-ID: Subject: Re: [PATCH v2 0/2] mm,fork,security: introduce MADV_WIPEONFORK To: Rik van Riel Cc: Mike Kravetz , Florian Weimer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, Kees Cook , luto@amacapital.net, Will Drewry , mingo@kernel.org, kirill@shutemov.name, dave.hansen@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 27 On Tue, Aug 8, 2017 at 5:46 PM, Rik van Riel wrote: >> If the use case is fairly specific, then perhaps it makes sense to >> make MADV_WIPEONFORK not applicable (EINVAL) for mappings where the >> result is 'questionable'. > > That would be a question for Florian and Colm. > > If they are OK with MADV_WIPEONFORK only working on > anonymous VMAs (no file mapping), that certainly could > be implemented. Anonymous would be sufficient for all of the Crypto-cases that I've come across. But I can imagine someone wanting to initialize all application state from a saved file, or share it between processes. The comparable minherit call sidesteps all of this by simply documenting that it results in a new anonymous page after fork, and so the previous state doesn't matter. Maybe the problem here is the poor name (my fault). WIPEONFORK suggests an action being taken ... like a user might think that it literally zeroes a file, for example. At the risk of bike shedding: maybe ZEROESONFORK would resolve that small ambiguity? -- Colm