Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4648096yba; Wed, 10 Apr 2019 01:48:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzkLIXgLjhF74vAiUU/wWthdCthdUznizdqZxwnzVJEuRbSnwsgILpnx4wi9rlzb6KvACv X-Received: by 2002:a65:5ac3:: with SMTP id d3mr40721736pgt.168.1554886102126; Wed, 10 Apr 2019 01:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554886102; cv=none; d=google.com; s=arc-20160816; b=kkQu33fHhyQpo0x1N0M5wxcT8SBUrqYGg9NNyktRlKnAveHylqRzaaUSt61wmw/Hz7 EgaicwK5ndVbaIPJZuB0ltEBDHLFWVnAodsg0P4s+FCAv5goKp6W/ylblguD4zZHx0Dh JiTSPoTdjas9V+VRn4VDyDRAAHFxvDaAwKSDZLM08rDzsE9No700W3B5MOT0lX+J3k5K 4/afE6HDFPMHwW5jgviMJOerVlK6XLyKccx2KTM7c8fF2NP/gdym/hnMjbEMUaVaHDXj 95BAWa3lJMuWh05mwso299Zgi+BYlsSy69oUdpkchc6tZe7mfcxEyja2jj19fiZi8dHO Mrow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Q6IKcts9K6jG5BnhXi+W/xQfDM0V2xlEsrUrw5ztWk0=; b=Sd4V/22frwOEsddcv3xM2gsGDYFZAc/7f/k2DWdxTCUkfXi1DMhTsvCu1fxhglxIcf kdysrQk8SmSGFHp900HmVtbGuw98YDsNRmB2XgLXsQy6N6mkOPq66JTwBOQ+CV1RngEQ JLNHooNbu+x31R4zsQAxrxL1y6J7iMITetfQSvJjA690qc3u0Vvz4UYIFraPvpKf9/jY o3S40GB5bLwEAWp/yTSYCVXgai+63RHvzhw6oByt0onivvvDw+T5/2s6c8AKssKQ98/A VgYnwLzerk3CKQ8c1P9H/d6cIDktEiyeziR5fTkAmI+Y663dbwt3UrdvRXWPbk3ufU50 kbkQ== 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 32si31416023pgz.259.2019.04.10.01.48.04; Wed, 10 Apr 2019 01:48:22 -0700 (PDT) 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 S1728979AbfDJHd2 (ORCPT + 99 others); Wed, 10 Apr 2019 03:33:28 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:59251 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbfDJHd2 (ORCPT ); Wed, 10 Apr 2019 03:33:28 -0400 X-Originating-IP: 81.250.144.103 Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BF3AAFF80C; Wed, 10 Apr 2019 07:33:21 +0000 (UTC) Subject: Re: [PATCH v2 2/5] arm64, mm: Move generic mmap layout functions to mm To: Christoph Hellwig Cc: Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Burton , Alexander Viro , James Hogan , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Luis Chamberlain References: <20190404055128.24330-1-alex@ghiti.fr> <20190404055128.24330-3-alex@ghiti.fr> <20190410065908.GC2942@infradead.org> From: Alexandre Ghiti Message-ID: <8d482fd0-b926-6d11-0554-a0f9001d19aa@ghiti.fr> Date: Wed, 10 Apr 2019 09:32:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20190410065908.GC2942@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2019 08:59 AM, Christoph Hellwig wrote: > On Thu, Apr 04, 2019 at 01:51:25AM -0400, Alexandre Ghiti wrote: >> - fix the case where stack randomization should not be taken into >> account. > Hmm. This sounds a bit vague. It might be better if something > considered a fix is split out to a separate patch with a good > description. Ok, I will move this fix in another patch. > >> +config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT >> + bool >> + help >> + This allows to use a set of generic functions to determine mmap base >> + address by giving priority to top-down scheme only if the process >> + is not in legacy mode (compat task, unlimited stack size or >> + sysctl_legacy_va_layout). > Given that this is an option that is just selected by other Kconfig > options the help text won't ever be shown. I'd just move it into a > comment bove the definition. Oh yes, it does not appear, thanks, I'll move it above the definition. > >> +#ifdef CONFIG_MMU >> +#ifdef CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT > I don't think we need the #ifdef CONFIG_MMU here, > CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT should only be selected > if the MMU is enabled to start with. Ok, thanks. >> +#ifdef CONFIG_ARCH_HAS_ELF_RANDOMIZE >> +unsigned long arch_mmap_rnd(void) > Now that a bunch of architectures use a version in common code > the arch_ prefix is a bit mislead. Probably not worth changing > here, but some time in the future it could use a new name. Ok I'll keep it in mind for later, Thanks for your time, Alex