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:37:01 -0700 [thread overview]
Message-ID: <98656.1706128621@cvs.openbsd.org> (raw)
In-Reply-To: <20240124200628.ti327diy7arb7byb@revolver>
Liam R. Howlett <Liam.Howlett@Oracle.com> wrote:
> > Adding mseal() into picture, however, the heap is then sealed
> > partially, user can still free it, but the memory remains to be RO,
> > and the result of brk-shrink is nondeterministic, depending on if
> > munmap() will try to free the sealed memory.(brk uses munmap to shrink
> > the heap).
"You are holding it wrong".
> > [...]. We could document above mentioned limitations so devs are
> > more careful at the time to choose what memory to seal.
You mean like they need to be careful what memory they map, careful
what memory they unmap, careful what they do with mprotect, careful
about not writing or reading out of bounds, etc. They need to be
careful about everything.
Programmers have complete control over the address space in a program.
This is Linux we are talking about, it still doesn't have strict policy
on W | X memory, but misuse of mseal is suddenly a developer crisis?
Why is this memory attribute different, and how does it actually help?
When they use mseal on objects with unproven future, the program will
crash later, beautifully demonstrating that they held it wrong. Then
they can fix their abusive incorrect code.
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
to always use MAP_SEALABLE in their mmap() calls.
next prev parent reply other threads:[~2024-01-24 20:37 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 [this message]
2024-01-24 20:51 ` Theo de Raadt
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=98656.1706128621@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