linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Kees Cook <keescook@chromium.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Palmer Dabbelt <palmer@sifive.com>,
	Will Deacon <will.deacon@arm.com>,
	Russell King <linux@armlinux.org.uk>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	linux-mm@kvack.org, Paul Burton <paul.burton@mips.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	James Hogan <jhogan@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH v2 2/5] arm64, mm: Move generic mmap layout functions to mm
Date: Tue, 9 Apr 2019 23:59:08 -0700	[thread overview]
Message-ID: <20190410065908.GC2942@infradead.org> (raw)
In-Reply-To: <20190404055128.24330-3-alex@ghiti.fr>

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.

  reply	other threads:[~2019-04-10  6:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  5:51 [PATCH v2 0/5] Provide generic top-down mmap layout functions Alexandre Ghiti
2019-04-04  5:51 ` [PATCH v2 1/5] mm, fs: Move randomize_stack_top from fs to mm Alexandre Ghiti
2019-04-10  6:54   ` Christoph Hellwig
2019-04-10  7:18     ` Alexandre Ghiti
2019-04-04  5:51 ` [PATCH v2 2/5] arm64, mm: Move generic mmap layout functions " Alexandre Ghiti
2019-04-10  6:59   ` Christoph Hellwig [this message]
2019-04-10  7:32     ` Alexandre Ghiti
2019-04-10 18:27       ` Kees Cook
2019-04-11  7:16         ` Alexandre Ghiti
2019-04-04  5:51 ` [PATCH v2 3/5] arm: Use generic mmap top-down layout Alexandre Ghiti
2019-04-04  5:51 ` [PATCH v2 4/5] mips: " Alexandre Ghiti
2019-04-04  5:51 ` [PATCH v2 5/5] riscv: Make mmap allocation top-down by default Alexandre Ghiti
2019-04-10  6:59   ` Christoph Hellwig
2019-04-10  7:18     ` Alexandre Ghiti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190410065908.GC2942@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=catalin.marinas@arm.com \
    --cc=jhogan@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mcgrof@kernel.org \
    --cc=palmer@sifive.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).