From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdIKLKf (ORCPT ); Mon, 11 Sep 2017 07:10:35 -0400 Received: from verein.lst.de ([213.95.11.211]:45739 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdIKLKc (ORCPT ); Mon, 11 Sep 2017 07:10:32 -0400 Date: Mon, 11 Sep 2017 13:10:30 +0200 From: Christoph Hellwig To: Jan Kara Cc: Dan Williams , torvalds@linux-foundation.org, Arnd Bergmann , linux-nvdimm@lists.01.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andy Lutomirski , Andrew Morton , hch@lst.de Subject: Re: [RFC PATCH v8 2/2] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags 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-Disposition: inline In-Reply-To: <20170911094714.GD8503@quack2.suse.cz> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.