From: Kees Cook <keescook@chromium.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jiri Kosina <jikos@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Qi Zheng <zhengqi.arch@bytedance.com>,
Alexandre Ghiti <alexghiti@rivosinc.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Eric Biederman <ebiederm@xmission.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Josh Poimboeuf <jpoimboe@kernel.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Brian Gerst <brgerst@gmail.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Tony Battersby <tonyb@cybernetics.com>,
linux-kernel@vger.kernel.org, y0un9n132@gmail.com,
x86@kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 0/2] Adjust brk randomness
Date: Sat, 17 Feb 2024 17:25:32 -0800 [thread overview]
Message-ID: <202402171723.914538A526@keescook> (raw)
In-Reply-To: <05E12A71-D8A4-4E6D-9C9D-024251C1BDC7@zytor.com>
On Sat, Feb 17, 2024 at 04:25:33PM -0800, H. Peter Anvin wrote:
> On February 16, 2024 10:25:42 PM PST, Kees Cook <keescook@chromium.org> wrote:
> >Hi,
> >
> >It was recently pointed out[1] that x86_64 brk entropy was not great,
> >and that on all architectures the brk can (when the random offset is 0)
> >be immediately adjacent to .bss, leaving no gap that could stop linear
> >overflows from the .bss. Address both issues.
> >
> >-Kees
> >
> >Link: https://lore.kernel.org/linux-hardening/CA+2EKTVLvc8hDZc+2Yhwmus=dzOUG5E4gV7ayCbu0MPJTZzWkw@mail.gmail.com [1]
> >
> >Kees Cook (2):
> > x86: Increase brk randomness entropy on x86_64
> > binfmt_elf: Leave a gap between .bss and brk
> >
> > arch/x86/kernel/process.c | 5 ++++-
> > fs/binfmt_elf.c | 3 +++
> > 2 files changed, 7 insertions(+), 1 deletion(-)
> >
>
> Why do we even have the brk, or perhaps more importantly, why do we use it? Is there any reason whatsoever why glibc uses brk instead of mmap to her heap memory?
>
> I thought the base of the brk wasn't even known to userspace other than in the form of the image end...
AFAIK, it's part of ELF ABI, and the loader uses it only for very early
allocations. e.g. it's what shows up as "[heap]" in /proc/$pid/maps.
It's also available to any program that wants it still (see "man brk").
I don't think glibc has plans to redirect it.
--
Kees Cook
prev parent reply other threads:[~2024-02-18 1:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-17 6:25 [PATCH 0/2] Adjust brk randomness Kees Cook
2024-02-17 6:25 ` [PATCH 1/2] x86: Increase brk randomness entropy on x86_64 Kees Cook
2024-02-26 10:39 ` Jiri Kosina
2024-02-17 6:25 ` [PATCH 2/2] binfmt_elf: Leave a gap between .bss and brk Kees Cook
2024-04-24 19:20 ` (subset) " Kees Cook
2024-02-18 0:25 ` [PATCH 0/2] Adjust brk randomness H. Peter Anvin
2024-02-18 1:25 ` Kees Cook [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=202402171723.914538A526@keescook \
--to=keescook@chromium.org \
--cc=alexghiti@rivosinc.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=brauner@kernel.org \
--cc=brgerst@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=dave.hansen@linux.intel.com \
--cc=ebiederm@xmission.com \
--cc=geert@linux-m68k.org \
--cc=hpa@zytor.com \
--cc=jack@suse.cz \
--cc=jikos@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=tglx@linutronix.de \
--cc=tonyb@cybernetics.com \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.org \
--cc=y0un9n132@gmail.com \
--cc=zhengqi.arch@bytedance.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).