Received: by 10.223.164.202 with SMTP id h10csp132183wrb; Mon, 13 Nov 2017 04:02:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMa6xkNtefbXRKYG0ijkmcqSWQji5dEniVyXNeZZklHvRfIJvS7VK7Pmnd3qfBhCacWft9Lk X-Received: by 10.84.234.9 with SMTP id m9mr8964602plk.3.1510574520629; Mon, 13 Nov 2017 04:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510574520; cv=none; d=google.com; s=arc-20160816; b=opTSmA8c/ho+cWGIq5CTbvFTwEqr2VnSLiHYydwVKQUlAr4PrA2WlH1p0mDEf4gUgX cTGOkTzo1g9mHcObc4Z8WWQQC53RAqolJ15X0t9TvujVNPhwTj3C9gV3lc7GZS2PHT48 a9wtlMpRY32OQqwaPXkZ7X9MFih/VntLMG2Wy60x7R60ggmmd9yFbKP+gnPpUn8s1Gid JjaNamRP/fRNKo0j4QqmJ13NDaJaBQcrUGJvLMo9HJXS+ANVCRJw3uILHqDZS41MVJWB VbtIpZruoPELWJDdyZBNgs0s76EeDh46brAXO3Dvj2N67y75fiDnzC3+jFy/zUEEFVDN Olig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uxCRvCh1Ftey2VcHX418MAwXu71RGZ+1STs9RXVZoko=; b=a+qoOwaGDMyPwLsAgSwYeF4PxpYIkqessWp7Zgr/fAujxnQhFWxSYesmC/FR9V5K7a IfzBiCz3cw+XXbj4B1h/vNMlG9Hb5Ri/tk6RImbUJ5USaxYq/lzEW31J/wv5AD7+uJQv i5kX40AKQzW5u5ieeQyhkZsVeCXBL+YX8XEV+lONiGGHbXwL6kb/pz/cURcj2TIMu1MZ CTmISoTvGSbbMYKuqiUQM5lRqNPbyzw9Hmw78ydejvXTuICXv8LjUL8M8CykrvUJPFt/ SodJ+NXSiaYE0Jn0DIRPTdEO8xcKqp9cegqKh4jvPVuHQgQP8mzRnoBdBLHfifnnyPer HC2A== ARC-Authentication-Results: i=1; mx.google.com; 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 q9si14693648plr.526.2017.11.13.04.01.46; Mon, 13 Nov 2017 04:02:00 -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; 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 S1751978AbdKMMBG (ORCPT + 95 others); Mon, 13 Nov 2017 07:01:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:45728 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdKMMBE (ORCPT ); Mon, 13 Nov 2017 07:01:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 803A2ABFC; Mon, 13 Nov 2017 12:01:02 +0000 (UTC) Date: Mon, 13 Nov 2017 13:00:57 +0100 From: Michal Hocko To: Michael Ellerman Cc: Joel Stanley , Stephen Rothwell , Andrew Morton , Linux-Next Mailing List , Linux Kernel Mailing List , Russell King , Benjamin Herrenschmidt , Abdul Haleem , Ralf Baechle , "James E.J. Bottomley" , Helge Deller , Yoshinori Sato , Rich Felker , "David S. Miller" , Chris Zankel , Max Filippov , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: linux-next: Tree for Nov 7 Message-ID: <20171113120057.555mvrs4fjq5tyng@dhcp22.suse.cz> References: <20171107162217.382cd754@canb.auug.org.au> <20171108142050.7w3yliulxjeco3b7@dhcp22.suse.cz> <20171110123054.5pnefm3mczsfv7bz@dhcp22.suse.cz> <20171113092006.cjw2njjukt6limvb@dhcp22.suse.cz> <20171113094203.aofz2e7kueitk55y@dhcp22.suse.cz> <87lgjawgx1.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lgjawgx1.fsf@concordia.ellerman.id.au> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 13-11-17 22:34:50, Michael Ellerman wrote: > Hi Michal, > > Michal Hocko writes: > > On Mon 13-11-17 10:20:06, Michal Hocko wrote: > >> [Cc arm and ppc maintainers] > > > > Hmm, it turned out to be a problem on other architectures as well. > > CCing more maintainers. For your reference, we are talking about > > http://lkml.kernel.org/r/20171023082608.6167-1-mhocko@kernel.org > > which has broken architectures which do apply aligning on the mmap > > address hint without MAP_FIXED applied. See below my proposed way > > around this issue because I belive that the above patch is quite > > valuable on its own to be dropped for all archs. > > I don't really like your solution sorry :) The fact that you've had to > patch seven arches seems like a red flag. > > I think this is a generic problem with MAP_FIXED, which I've heard > userspace folks complain about in the past. The thing is that we canno change MAP_FIXED behavior as it is carved in stone > Currently MAP_FIXED does two things: > 1. makes addr not a hint but the required address > 2. blasts any existing mapping > > You want 1) but not 2). + fail if there is a clashing range > So the right solution IMHO would be to add a new mmap flag to request > that behaviour, ie. a fixed address but iff there is nothing already > mapped there. > > I don't know the mm code well enough to know if that's hard for some > reason, but it *seems* like it should be doable. Yes, I have mentioned that in the previous email but the amount of code would be even larger. Basically every arch which reimplements arch_get_unmapped_area would have to special case new MAP_FIXED flag to do vma lookup. So this was the most simple solution I could come up with. If there was a general interest for MAP_FIXED_SAFE then we can introduce it later of course. I would just like the hardening merged sooner rather than later. -- Michal Hocko SUSE Labs From 1583950542108622250@xxx Mon Nov 13 11:35:50 +0000 2017 X-GM-THRID: 1583423641769727671 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread