Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbdLFHdm (ORCPT ); Wed, 6 Dec 2017 02:33:42 -0500 Received: from mail01.prevas.se ([62.95.78.3]:4394 "EHLO mail01.prevas.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752909AbdLFHdj (ORCPT ); Wed, 6 Dec 2017 02:33:39 -0500 X-IronPort-AV: E=Sophos;i="5.45,367,1508796000"; d="scan'208";a="2917686" Subject: Re: [PATCH 0/2] mm: introduce MAP_FIXED_SAFE To: Michael Ellerman , Michal Hocko , Kees Cook CC: Linux API , Khalid Aziz , Andrew Morton , Russell King - ARM Linux , Andrea Arcangeli , Linux-MM , LKML , linux-arch , Florian Weimer , John Hubbard , Abdul Haleem , Joel Stanley References: <20171129144219.22867-1-mhocko@kernel.org> <20171130065835.dbw4ajh5q5whikhf@dhcp22.suse.cz> <87zi6we9z2.fsf@concordia.ellerman.id.au> From: Rasmus Villemoes Message-ID: Date: Wed, 6 Dec 2017 08:33:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <87zi6we9z2.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.8.31] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 934 Lines: 26 On 2017-12-06 05:50, Michael Ellerman wrote: > Michal Hocko writes: > >> On Wed 29-11-17 14:25:36, Kees Cook wrote: >> It is safe in a sense it doesn't perform any address space dangerous >> operations. mmap is _inherently_ about the address space so the context >> should be kind of clear. > > So now you have to define what "dangerous" means. > >>> MAP_FIXED_UNIQUE >>> MAP_FIXED_ONCE >>> MAP_FIXED_FRESH >> >> Well, I can open a poll for the best name, but none of those you are >> proposing sound much better to me. Yeah, naming sucks... I also don't like the _SAFE name - MAP_FIXED in itself isn't unsafe [1], but I do agree that having a way to avoid clobbering (parts of) an existing mapping is quite useful. Since we're bikeshedding names, how about MAP_FIXED_EXCL, in analogy with the O_ flag. [1] I like the analogy between MAP_FIXED and dup2 made in . Rasmus