Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4609829yba; Wed, 10 Apr 2019 00:46:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3nxCVNQN5/dcOXzjL+5BPN/Cv+zIFYUFIGqfg20zvT5dqK2waWPBPsUTc0zXNRD6YjSkp X-Received: by 2002:a17:902:44a4:: with SMTP id l33mr42327769pld.292.1554882379109; Wed, 10 Apr 2019 00:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554882379; cv=none; d=google.com; s=arc-20160816; b=J/OVecx73y7fE7ufnKDODOvywnPQsHusDZYjv6HUgaY8+JmTG6r5/zIGCGXjSWN9Z8 upX5cKvZpJRxgygCBpikXV2z3ym8YaKcZ34fMP0TiWNtLAbh190q91oM3w1VW9t4bFh3 5l2PwbJDn1kCX7r9ZoKKESUqbSRvvneR/CjbQWvXW6c4O6pHzrrXGk8CB5LrCHQLM81T wkQbjoVQiw3Clb7ADItMqOwCLefkHS8QN+C1Ls6kx3kxnSqy6haopS5d+2kKrsGiuSIf slNJJ4rcL5Frr83FE3N3Sm0zaUeRPHHmF9/sABk4lkWXtXsTfJn8AKvfg7l9ndGjcIZl 7b8g== 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:dkim-signature; bh=Pa9yXGXWbJBeYpUWKfQ3OcoqrYebqvpcXb3jKozmpHo=; b=sYVcqgO+vNUpbTsva3lkTKGt4x1B5Rmv80APA99kNcX1pvD2LH9sDPsk0Mde3RKSL6 UvFhBK2PhKRXwP3QiHm7X6b12KpF/R7C/hK6lQP5vVp5VBdnAU5P/HcEezDJj6DKOpaL QsE0pRZLJxTY8FthIlfw1LtmcC7t+NwINOcZukMHNP0pECuf78ah1svrySiBtyCooak8 zv3Lrl4jCuk/FZp1k94z4x2C4fR6CkOqkmFpfTkHx+99dhtQpRF8zpGJfxUp5pPce2Sv uBHW3t2EetffpJUu6ARSjZfq1cW7g9qnF5K16sUcQ2AlpxaMhHVb8XZ6Hnl3uzPOrLuq UU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kKWEuING; 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 h128si31095206pgc.488.2019.04.10.00.46.03; Wed, 10 Apr 2019 00:46:19 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kKWEuING; 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 S1728856AbfDJG7R (ORCPT + 99 others); Wed, 10 Apr 2019 02:59:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58722 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728647AbfDJG7Q (ORCPT ); Wed, 10 Apr 2019 02:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Pa9yXGXWbJBeYpUWKfQ3OcoqrYebqvpcXb3jKozmpHo=; b=kKWEuING3f2F4y1Crs43dW3di 7Bgxl9UZq1ZWxGCBndfeH4As6FMxSHsqaBeXbGy1nKaBH4fcs4OGwRybfuk4thgRdacux+1NeL1wd fZ6MJ5QYy6PgmfZlZ1HuxBa2ZUuT4ynZ1HRd05tlU6w3HRdXC5FyER53UnJmZ3eODIvvVSDtMzA1o y0AmGJwp57NBJKxbBbCHJh4/wf99JEbw+dEwYWXttkE5YROQ6NdHe5mr0dWl2/XApRnu9i+o1aNrt ekUQ+YuDTPg9b5SNQIt5cFJD4lyNzNCzk4BP4gjihHO/QIWHLOmKmkyDFDaFRJut/1iiO9BJAP5q3 475Whn/4g==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE7CO-0003NH-8Q; Wed, 10 Apr 2019 06:59:08 +0000 Date: Tue, 9 Apr 2019 23:59:08 -0700 From: Christoph Hellwig To: Alexandre Ghiti Cc: Andrew Morton , Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Paul Burton , Alexander Viro , James Hogan , linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Luis Chamberlain Subject: Re: [PATCH v2 2/5] arm64, mm: Move generic mmap layout functions to mm Message-ID: <20190410065908.GC2942@infradead.org> References: <20190404055128.24330-1-alex@ghiti.fr> <20190404055128.24330-3-alex@ghiti.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190404055128.24330-3-alex@ghiti.fr> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > +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. > +#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. > +#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.