From: "Theo de Raadt" <deraadt@openbsd.org>
To: "Liam R. Howlett" <Liam.Howlett@Oracle.com>,
Jeff Xu <jeffxu@chromium.org>,
akpm@linux-foundation.org, keescook@chromium.org,
jannh@google.com, sroettger@google.com, willy@infradead.org,
gregkh@linuxfoundation.org, torvalds@linux-foundation.org,
usama.anjum@collabora.com, rdunlap@infradead.org,
jeffxu@google.com, jorgelo@chromium.org, groeck@chromium.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, pedro.falcato@gmail.com,
dave.hansen@intel.com, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v7 2/4] mseal: add mseal syscall
Date: Wed, 24 Jan 2024 13:51:37 -0700 [thread overview]
Message-ID: <82138.1706129497@cvs.openbsd.org> (raw)
In-Reply-To: <98656.1706128621@cvs.openbsd.org>
Theo de Raadt <deraadt@openbsd.org> wrote:
> This discussion about the malloc heap is ridiculous. Obviously it is
> programmer error to lock the permissions on memory you will free for
> reuse. But you can't fix this problem with malloc(), without breaking
> other extremely common circumstances where the allocation of memory
> and PERMANENT-USE-WITHOUT-RELEASE of such memory are seperated over a
> memory boundary, unless you start telling all open source library authors
^^^^^^^^^^^^^^^ library boundary, sorry
> to always use MAP_SEALABLE in their mmap() calls.
Example:
1. libcrypto (or some other library) has some ways to allocate memory and
provide it to an application.
2. Even if this is using malloc(), heap allocations over a pagesize are
page-aligned, so even then following assumptions are sound.
3. I have an application which uses that memory, but will never release the memory
until program termination
4. The library interface is public and used by many programs, so the library
author has a choice of using MAP_SEALABLE or not using MAP_SEALABLE
Due to your choice, my application cannot make lock the memory permissions
unless that library author chooses MAP_SEALABLE
If they choose to use MAP_SEALABLE, all programs get this memory you consider
less safe.
Exactly what is being gained here?
next prev parent reply other threads:[~2024-01-24 20:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 15:28 [PATCH v7 0/4] Introduce mseal() jeffxu
2024-01-22 15:28 ` [PATCH v7 1/4] mseal: Wire up mseal syscall jeffxu
2024-01-22 15:28 ` [PATCH v7 2/4] mseal: add " jeffxu
2024-01-23 18:14 ` Liam R. Howlett
2024-01-24 17:50 ` Jeff Xu
2024-01-24 20:06 ` Liam R. Howlett
2024-01-24 20:37 ` Theo de Raadt
2024-01-24 20:51 ` Theo de Raadt [this message]
2024-01-24 22:49 ` Jeff Xu
2024-01-25 2:04 ` Jeff Xu
2024-01-22 15:28 ` [PATCH v7 3/4] selftest mm/mseal memory sealing jeffxu
2024-01-22 15:28 ` [PATCH v7 4/4] mseal:add documentation jeffxu
2024-01-22 15:49 ` [PATCH v7 0/4] Introduce mseal() Theo de Raadt
2024-01-22 22:10 ` Jeff Xu
2024-01-22 22:34 ` Theo de Raadt
2024-01-23 17:33 ` Liam R. Howlett
2024-01-23 18:58 ` Theo de Raadt
2024-01-24 18:56 ` Jeff Xu
2024-01-24 18:55 ` Jeff Xu
2024-01-24 19:17 ` Theo de Raadt
2024-01-29 22:36 ` Jonathan Corbet
2024-01-31 17:49 ` Jeff Xu
2024-01-31 20:51 ` Jonathan Corbet
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=82138.1706129497@cvs.openbsd.org \
--to=deraadt@openbsd.org \
--cc=Liam.Howlett@Oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=jeffxu@google.com \
--cc=jorgelo@chromium.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pedro.falcato@gmail.com \
--cc=rdunlap@infradead.org \
--cc=sroettger@google.com \
--cc=torvalds@linux-foundation.org \
--cc=usama.anjum@collabora.com \
--cc=willy@infradead.org \
/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).