From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbdIKLpT (ORCPT ); Mon, 11 Sep 2017 07:45:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:32844 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750980AbdIKLpR (ORCPT ); Mon, 11 Sep 2017 07:45:17 -0400 Date: Mon, 11 Sep 2017 13:45:15 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jan Kara , 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 Subject: Re: [RFC PATCH v8 2/2] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags Message-ID: <20170911114515.GG8503@quack2.suse.cz> 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> <20170911111030.GA20127@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170911111030.GA20127@lst.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 11-09-17 13:10:30, Christoph Hellwig wrote: > 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. Hum, I don't remember your concern and the only comment from you to the last posting which I've found is: "no mmap3 syscall here :) Do you also need to update the nommu mmap implementation?" So I guess it's something else. So can you remind me or send a link? Thanks! Honza -- Jan Kara SUSE Labs, CR