From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [RFC PATCH v8 2/2] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags Date: Mon, 11 Sep 2017 13:10:30 +0200 Message-ID: <20170911111030.GA20127@lst.de> References: <150489930202.29460.5141541423730649272.stgit@dwillia2-desk3.amr.corp.intel.com> <150489931339.29460.8760855724603300792.stgit@dwillia2-desk3.amr.corp.intel.com> <20170911094714.GD8503@quack2.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170911094714.GD8503-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Jan Kara Cc: Arnd Bergmann , linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hch-jcswGhMUV9g@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Andy Lutomirski , torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, Andrew Morton List-Id: linux-api@vger.kernel.org On Mon, Sep 11, 2017 at 11:47:14AM +0200, Jan Kara wrote: > On Fri 08-09-17 12:35:13, Dan Williams wrote: > > The mmap(2) syscall suffers from the ABI anti-pattern of not validating > > unknown flags. However, proposals like MAP_SYNC and MAP_DIRECT need a > > mechanism to define new behavior that is known to fail on older kernels > > without the support. Define a new MAP_SHARED_VALIDATE flag pattern that > > is guaranteed to fail on all legacy mmap implementations. > > > > With this in place new flags can be defined as: > > > > #define MAP_new (MAP_SHARED_VALIDATE | val) > > Is this changelog stale? Given MAP_SHARED_VALIDATE will be new mapping > type, I'd expect we define new flags just as any other mapping flags... > I see no reason why MAP_SHARED_VALIDATE should be or'ed to that. Btw, I still think it should be a new hidden flag and not a new mapping type. I brought this up last time, so maybe I missed the answer to my concern.