Received: by 10.223.164.202 with SMTP id h10csp4697599wrb; Wed, 29 Nov 2017 10:20:31 -0800 (PST) X-Google-Smtp-Source: AGs4zMblG8oJHwRMxubmEFj4IK0EUKYAm3IwxoPWkuGIVaKXb3vA5iDzbjgxulZWyrE7TqXjrLTG X-Received: by 10.159.246.134 with SMTP id c6mr3687725pls.371.1511979630948; Wed, 29 Nov 2017 10:20:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511979630; cv=none; d=google.com; s=arc-20160816; b=rsVgh/e+/W87RTNTB/pM6uSTW/KI3E0hIRtzT8jVc5lqKvpt8ayJtobeViYJJTWPkr Y2CfGN1HNw46/wsPd0yOVdJNWZq+IYDPUSjMCHnkG9em/dOaC2ELARLWeDtFw6ArbG1f iWeVDfqbGEjEiTQ0H61Wj3UpEs5PZC0drFs5JSjpb8y2us+R0x0HVAzr82fVqo0cuopp HBr0sYnsTYJS4u652UWkWx0i0vuy7VLeprNIO/ziURbjT3cAFv1tP2CTduuMuaod8saf s0OBzEUNN8w9VaNzwuislDOCm+/PnItv3x0WtnyoFRlMu93NR1s/7UpXqxxIjU0xggyd 4UjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=IkHEZML3OZJMQiy4fUoVh3wAmh2MD7Fp02t0ZxrNJUY=; b=b93WWmWVsRsIDIVu1KKcxrcrhMu7K5oJ5aSn1Yy4SIsXCGv2LHg5n4H/PEfz1MrRyn MDw35slnMbLO11j5+SW3WhPEPDeR4Hboh5EB6l8lnnVUpntRaqjP2GpMmV7sgbPL2tHJ WBL9yM2GIYC71udYkkpydicrfrUi5DjKXA3Sa8DNL6fYwtCG4TffWLW6MFHs1wDSz5h6 u63AKZZtyE6QgiyH7FTvO6aSShV5Yc53cVOwqV4akK7/+3v1+ytRVX/laj2Npmtskdga LiYwmYu8Fdz6NW496Ra9lcZwzmKNba89eEZT1q+TmHfdO6npR0v0gTukyHv1msRf4Mor 2TQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport2 header.b=Gw5xvpYe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u91si1667757plb.50.2017.11.29.10.20.20; Wed, 29 Nov 2017 10:20:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport2 header.b=Gw5xvpYe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995AbdK2PTw (ORCPT + 69 others); Wed, 29 Nov 2017 10:19:52 -0500 Received: from mail02.prevas.se ([62.95.78.10]:29256 "EHLO mail02.prevas.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbdK2PTu (ORCPT ); Wed, 29 Nov 2017 10:19:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=1276; q=dns/txt; s=ironport2; t=1511968790; x=1543504790; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=6/bOlBn76aV2/O5sNrXeytNrUAhZHUgZr0i6LU28jYk=; b=Gw5xvpYeir2kWjtH6yqQ9xZpzycpxpenHBmZ87LKbQMDLuN/MsTdmD2U gMsMovVegAjPijD8ieE73kAWzk2ZMQ/ziAESJhqDLyY818lYHXADQO44C ocfR8sWBKrkI9DOzgnFvwM83ADludnNk+qeJgQ2MugVa733PbIU+dT+9v Q=; X-IronPort-AV: E=Sophos;i="5.44,473,1505772000"; d="scan'208";a="2743695" Received: from vmprevas4.prevas.se (HELO smtp.prevas.se) ([172.16.8.104]) by ironport2.prevas.se with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2017 16:13:54 +0100 Received: from [172.16.11.34] (172.16.8.31) by smtp.prevas.se (172.16.8.104) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 29 Nov 2017 16:13:54 +0100 Subject: Re: [PATCH 0/2] mm: introduce MAP_FIXED_SAFE To: Michal Hocko , CC: Khalid Aziz , Michael Ellerman , Andrew Morton , Russell King - ARM Linux , Andrea Arcangeli , , LKML , , Florian Weimer , John Hubbard , Abdul Haleem , Joel Stanley , Kees Cook , Michal Hocko References: <20171129144219.22867-1-mhocko@kernel.org> From: Rasmus Villemoes Message-ID: Date: Wed, 29 Nov 2017 16:13:53 +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: <20171129144219.22867-1-mhocko@kernel.org> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-29 15:42, Michal Hocko wrote: > > The first patch introduced MAP_FIXED_SAFE which enforces the given > address but unlike MAP_FIXED it fails with ENOMEM if the given range > conflicts with an existing one. [s/ENOMEM/EEXIST/, as it seems you also did in the actual patch and changelog] >The flag is introduced as a completely > new one rather than a MAP_FIXED extension because of the backward > compatibility. We really want a never-clobber semantic even on older > kernels which do not recognize the flag. Unfortunately mmap sucks wrt. > flags evaluation because we do not EINVAL on unknown flags. On those > kernels we would simply use the traditional hint based semantic so the > caller can still get a different address (which sucks) but at least not > silently corrupt an existing mapping. I do not see a good way around > that. I think it would be nice if this rationale was in the 1/2 changelog, along with the hint about what userspace that wants to be compatible with old kernels will have to do (namely, check that it got what it requested) - which I see you did put in the man page. -- Rasmus Villemoes Software Developer Prevas A/S Hedeager 3 DK-8200 Aarhus N +45 51210274 rasmus.villemoes@prevas.dk www.prevas.dk From 1585425551136587163@xxx Wed Nov 29 18:20:28 +0000 2017 X-GM-THRID: 1585411913295978731 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread