From: Paul Walmsley <pjw@kernel.org>
To: Michael Ellerman <mpe@kernel.org>
Cc: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: defconfig: Disable COMPAT_BRK
Date: Wed, 4 Nov 2026 02:06:03 -0700 (MST) [thread overview]
Message-ID: <0b81d999-2aa1-83e3-6dce-e419ec5f55ac@kernel.org> (raw)
In-Reply-To: <20261029-compat-brk-v1-1-5b2cf86eb453@kernel.org>
On Thu, 29 Oct 2026, Michael Ellerman wrote:
> COMPAT_BRK defaults to y, which disables brk (heap) randomisation by
> default (ie. randomize_va_space=1 by default) for compatibility with
> "ancient" binaries, in particular libc5 based binaries.
>
> libc5 predates RISC-V, so there can't be any libc5 binaries for RISC-V.
>
> COMPAT_BRK was introduced in 2008, commit 32a932332c8b
> ("brk randomization: introduce CONFIG_COMPAT_BRK"). But even then the
> only non-libc5 binaries mentioned as being broken were ~5 year old
> versions of emacs (see commit c1d171a00294 ("x86: randomize brk")).
>
> Distro kernels for riscv64 also disable it, including Debian, Fedora,
> openSUSE and Ubuntu. So even if there were riscv binaries out there
> that rely on it, no mainstream distro would support them.
>
> Most other architectures already disable COMPAT_BRK in their primary
> defconfigs, including arm64, x86_64, powerpc, s390, loongarch and
> sparc64, as do the riscv nommu defconfigs. It is also disabled in
> kernel/configs/hardening.config.
>
> So disable COMPAT_BRK in the riscv defconfig so that brk is randomised
> by default, matching distro and other arch configs.
>
> Signed-off-by: Michael Ellerman <mpe@kernel.org>
Thanks, queued for v7.4-rc.
- Paul
prev parent reply other threads:[~2026-11-04 9:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 12:07 Michael Ellerman
2026-11-04 9:06 ` Paul Walmsley [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=0b81d999-2aa1-83e3-6dce-e419ec5f55ac@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mpe@kernel.org \
--cc=palmer@dabbelt.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®