linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Alex Ghiti <alex@ghiti.fr>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@lst.de>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	Palmer Dabbelt <palmer@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Luis Chamberlain <mcgrof@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH v3 04/11] arm64, mm: Move generic mmap layout functions to mm
Date: Thu, 18 Apr 2019 09:19:18 -0500	[thread overview]
Message-ID: <CAGXu5j+NkQ+nwRShuKeHMwuy6++3x0QMS9djE=wUzUUtAkVf3g@mail.gmail.com> (raw)
In-Reply-To: <fd2b02b3-5872-ccf6-9f52-53f692fba02d@ghiti.fr>

On Thu, Apr 18, 2019 at 12:55 AM Alex Ghiti <alex@ghiti.fr> wrote:
> Regarding the help text, I agree that it does not seem to be frequent to
> place
> comment above config like that, I'll let Christoph and you decide what's
> best. And I'll
> add the possibility for the arch to define its own STACK_RND_MASK.

Yeah, I think it's very helpful to spell out the requirements for new
architectures with these kinds of features in the help text (see
SECCOMP_FILTER for example).

> > I think CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT should select
> > CONFIG_ARCH_HAS_ELF_RANDOMIZE. It would mean moving
>
>
> I don't think we should link those 2 features together: an architecture
> may want
> topdown mmap and don't care about randomization right ?

Given that the mmap randomization and stack randomization are already
coming along for the ride, it seems weird to make brk randomization an
optional feature (especially since all the of the architectures you're
converting include it). I'd also like these kinds of security features
to be available by default. So, I think one patch to adjust the MIPS
brk randomization entropy and then you can just include it in this
move.

> Actually, I had to add those ifdefs for mmap_rnd_compat_bits, not
> is_compat_task.

Oh! In that case, use CONFIG_HAVE_ARCH_MMAP_RND_BITS. :) Actually,
what would be maybe cleaner would be to add mmap_rnd_bits_min/max
consts set to 0 for the non-CONFIG_HAVE_ARCH_MMAP_RND_BITS case at the
top of mm/mmap.c.

I really like this clean-up! I think we can move x86 to it too without
too much pain. :)

-- 
Kees Cook

  reply	other threads:[~2019-04-18 14:24 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17  5:22 [PATCH v3 00/11] Provide generic top-down mmap layout functions Alexandre Ghiti
2019-04-17  5:22 ` [PATCH v3 01/11] mm, fs: Move randomize_stack_top from fs to mm Alexandre Ghiti
2019-04-18  5:20   ` Kees Cook
2019-04-17  5:22 ` [PATCH v3 02/11] arm64: Make use of is_compat_task instead of hardcoding this test Alexandre Ghiti
2019-04-18  4:32   ` Kees Cook
2019-04-18  5:23     ` Alex Ghiti
2019-04-22 19:53   ` Christoph Hellwig
2019-04-17  5:22 ` [PATCH v3 03/11] arm64: Consider stack randomization for mmap base only when necessary Alexandre Ghiti
2019-04-18  4:37   ` Kees Cook
2019-04-18  5:24     ` Alex Ghiti
2019-04-22 19:53   ` Christoph Hellwig
2019-04-17  5:22 ` [PATCH v3 04/11] arm64, mm: Move generic mmap layout functions to mm Alexandre Ghiti
2019-04-18  5:17   ` Kees Cook
2019-04-18  5:55     ` Alex Ghiti
2019-04-18 14:19       ` Kees Cook [this message]
2019-04-19  7:20         ` Alex Ghiti
2019-04-22 19:55         ` Christoph Hellwig
2019-04-28 14:27         ` Alex Ghiti
2019-04-22 19:54   ` Christoph Hellwig
2019-04-17  5:22 ` [PATCH v3 05/11] arm: Properly account for stack randomization and stack guard gap Alexandre Ghiti
2019-04-18  5:26   ` Kees Cook
2019-04-18  6:01     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 06/11] arm: Use STACK_TOP when computing mmap base address Alexandre Ghiti
2019-04-18  5:27   ` Kees Cook
2019-04-18  6:04     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 07/11] arm: Use generic mmap top-down layout Alexandre Ghiti
2019-04-18  5:28   ` Kees Cook
2019-04-18  6:06     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 08/11] mips: Properly account for stack randomization and stack guard gap Alexandre Ghiti
2019-04-18  5:30   ` Kees Cook
2019-04-18  6:06     ` Alex Ghiti
2019-04-18 21:27   ` Paul Burton
2019-04-19  7:20     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 09/11] mips: Use STACK_TOP when computing mmap base address Alexandre Ghiti
2019-04-18  5:31   ` Kees Cook
2019-04-18  6:08     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 10/11] mips: Use generic mmap top-down layout Alexandre Ghiti
2019-04-18  5:31   ` Kees Cook
2019-04-18  6:08     ` Alex Ghiti
2019-04-17  5:22 ` [PATCH v3 11/11] riscv: Make mmap allocation top-down by default Alexandre Ghiti
2019-04-18  5:31   ` Kees Cook
2019-04-18  6:09     ` Alex Ghiti
2019-04-22 19:56   ` Christoph Hellwig

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='CAGXu5j+NkQ+nwRShuKeHMwuy6++3x0QMS9djE=wUzUUtAkVf3g@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=catalin.marinas@arm.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=jhogan@kernel.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).