Received: by 10.223.164.202 with SMTP id h10csp271579wrb; Tue, 14 Nov 2017 00:57:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMafcnabBEgw0Wyjj4pBisbH6IVnVtHDiCme1SdmI+zzZz/ypU+f/DK24QlWqcqgb+o1NuLr X-Received: by 10.98.141.89 with SMTP id z86mr12868017pfd.207.1510649830906; Tue, 14 Nov 2017 00:57:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510649830; cv=none; d=google.com; s=arc-20160816; b=bx2iIvg3mu4pL+jof9p7J7CK/+EOSQlz888ZZA0Dl51ZzYLr9osW/bnJs3ceJvc+3n gjeKaPrzUsbeQL5nrfOKtXsPS9hmIUaasyhUyPFV+gOTV1Jf090McQk9GYjJvGpk9IDg aXyl8+7xDZpQDPzQ1MmLGFaqpeblbaxyguZj7PUyJYDkKw71jMiNdI4Ne5/GZg3iTS0d UGC0tMX6RuaKpgRxbT/qwnE6j32ijZnozTAwmM3YIxnAbtezp7q9uCNznSpALYVacZVj 6tMM575UCWEaE1O9ciMUTlGn/y5zxQIVQOXCuT7uwYM+NTlbw6MXLiWkSYHr3C7/TXUg B3Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=+DrsQXlNbayz73D8XBdGQusIGolycPdrim1q2SYAQmg=; b=beaDQVWFJSWBguahjA9wErDcAeq5SGV4JLHYogwRfy/mDgo/qev1QXe8R6B0fPYfrD 1lQtUUcKRRgyBbrYeuurLRssH5GURfV6Ei+PdsZcP3F0RBSGpqjWppf7cB5t32VOs0lr 60qAbYGmuShv8LeDjihPV29GgEaLssXIiMEUqR6ZRMRUdolNbVzbmN5IVwC9k0Lhv+T3 2kJYdEhLdUMpjEvxaglv3BZBNJ+1MRjnJyccvros1qmr6gqqtfLIewb0e2pw70BJJ0N/ bUmScQWWTfj0G4888if/WN6ohg34rYl1M6b9H4k+cNktjS/qvHZtioARruV1shlzL3Ws M9Rw== 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 s5si9660961pgv.558.2017.11.14.00.56.58; Tue, 14 Nov 2017 00:57:10 -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 S1753905AbdKNIzL (ORCPT + 88 others); Tue, 14 Nov 2017 03:55:11 -0500 Received: from ozlabs.org ([103.22.144.67]:56509 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbdKNIzD (ORCPT ); Tue, 14 Nov 2017 03:55:03 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 3ybhCm48X0z9sPr; Tue, 14 Nov 2017 19:55:00 +1100 (AEDT) From: Michael Ellerman To: Michal Hocko 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 In-Reply-To: <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> <20171113120057.555mvrs4fjq5tyng@dhcp22.suse.cz> Date: Tue, 14 Nov 2017 19:54:59 +1100 Message-ID: <87h8txw87w.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko writes: > 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 Yes obviously. I didn't mean to imply we would change MAP_FIXED, rather we would add a new flag with the new semantics. >> 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 Yep. I thought that was implied :) >> 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. I'd have to look, but my memory of the arch code is that it doesn't deal with the vma so it wouldn't need any change. > 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. Sure. But in the scheme of things one more kernel release is not that big a deal to get it right. Given that the simple approach of dropping MAP_FIXED turns out to not be simple at all. cheers From 1584024423411111916@xxx Tue Nov 14 07:10:09 +0000 2017 X-GM-THRID: 1583423641769727671 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread