From: Damien Le Moal <dlemoal@kernel.org>
To: Kees Cook <kees@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>
Cc: Stefan O'Rear <sorear@fastmail.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Greg Ungerer <gerg@linux-m68k.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Eric Biederman <ebiederm@xmission.com>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Damien Le Moal <damien.lemoal@wdc.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2] binfmt_flat: Fix corruption when not offsetting data start
Date: Wed, 7 Aug 2024 12:53:14 -0700 [thread overview]
Message-ID: <0035d7a6-6a03-435c-a893-3a57a4319fd4@kernel.org> (raw)
In-Reply-To: <20240807195119.it.782-kees@kernel.org>
On 2024/08/07 12:51, Kees Cook wrote:
> Commit 04d82a6d0881 ("binfmt_flat: allow not offsetting data start")
> introduced a RISC-V specific variant of the FLAT format which does
> not allocate any space for the (obsolete) array of shared library
> pointers. However, it did not disable the code which initializes the
> array, resulting in the corruption of sizeof(long) bytes before the DATA
> segment, generally the end of the TEXT segment.
>
> Introduce MAX_SHARED_LIBS_UPDATE which depends on the state of
> CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET to guard the initialization of
> the shared library pointer region so that it will only be initialized
> if space is reserved for it.
>
> Fixes: 04d82a6d0881 ("binfmt_flat: allow not offsetting data start")
> Co-developed-by: Stefan O'Rear <sorear@fastmail.com>
> Signed-off-by: Stefan O'Rear <sorear@fastmail.com>
> Signed-off-by: Kees Cook <kees@kernel.org>
Looks good to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2024-08-07 19:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 19:51 Kees Cook
2024-08-07 19:53 ` Damien Le Moal [this message]
2024-08-07 23:39 ` Greg Ungerer
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=0035d7a6-6a03-435c-a893-3a57a4319fd4@kernel.org \
--to=dlemoal@kernel.org \
--cc=alex@ghiti.fr \
--cc=brauner@kernel.org \
--cc=damien.lemoal@wdc.com \
--cc=ebiederm@xmission.com \
--cc=gerg@linux-m68k.org \
--cc=jack@suse.cz \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=palmer@dabbelt.com \
--cc=sorear@fastmail.com \
--cc=viro@zeniv.linux.org.uk \
/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®