From: Rafael Aquini <aquini@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Heiko Carstens <hca@linux.ibm.com>,
Petr Mladek <pmladek@suse.com>, Mike Rapoport <rppt@kernel.org>,
Paul McKenney <paulmck@kernel.org>,
Samuel Holland <samuel.holland@sifive.com>
Subject: Re: [PATCH v2] mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default
Date: Wed, 12 Jun 2024 08:26:41 -0400 [thread overview]
Message-ID: <ZmmUAUl_zuXnA_0O@optiplex-fbsd> (raw)
In-Reply-To: <20240611194312.6048eba27c9ff3869040a35c@linux-foundation.org>
On Tue, Jun 11, 2024 at 07:43:12PM -0700, Andrew Morton wrote:
> On Tue, 11 Jun 2024 21:35:24 -0400 Rafael Aquini <aquini@redhat.com> wrote:
>
> > > Shouldn't we make this the default (at least for 32-bit) so the
> > > regressed kernels are fixed simply by applying this patch?
> > >
> >
> > That is a fair take, indeed. I guess we could do something like
> >
> > config FORCE_MAX_MMAP_RND_BITS
> > bool "Force maximum number of bits to use for ASLR of mmap base address"
> > - default n
> > + default y if !64BIT
>
> "something like" != "exhaustively tested" ;)
>
> I'll toss that in there, but please do let me know when it is suitable
> for an upstream merge.
>
The follow-up patch does work as intended:
[raquini@optiplex-lnx linux]$ make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'
#
# configuration written to .config
#
[raquini@optiplex-lnx linux]$ grep MMAP_RND_BITS .config
CONFIG_ARCH_MMAP_RND_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_BITS_MAX=16
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
# CONFIG_FORCE_MAX_MMAP_RND_BITS is not set
CONFIG_ARCH_MMAP_RND_BITS=8
[raquini@optiplex-lnx linux]$ patch -Np1 < patch.diff
patching file arch/Kconfig
[raquini@optiplex-lnx linux]$ make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'
#
# configuration written to .config
#
[raquini@optiplex-lnx linux]$ grep MMAP_RND_BITS .config
CONFIG_ARCH_MMAP_RND_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_BITS_MAX=16
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_FORCE_MAX_MMAP_RND_BITS=y
CONFIG_ARCH_MMAP_RND_BITS=16
> I also added cc:stable.
>
Thank you, Andrew.
prev parent reply other threads:[~2024-06-12 12:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 17:00 [PATCH] " Rafael Aquini
2024-06-06 18:06 ` [PATCH v2] " Rafael Aquini
2024-06-10 18:11 ` Andrew Morton
2024-06-10 18:45 ` Rafael Aquini
2024-06-11 21:32 ` Andrew Morton
2024-06-12 1:35 ` Rafael Aquini
2024-06-12 2:43 ` Andrew Morton
2024-06-12 12:26 ` Rafael Aquini [this message]
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=ZmmUAUl_zuXnA_0O@optiplex-fbsd \
--to=aquini@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pmladek@suse.com \
--cc=rppt@kernel.org \
--cc=samuel.holland@sifive.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
all inboxes | Powered by JetHome®