From: Kees Cook <kees@kernel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: jeffxu@chromium.org, akpm@linux-foundation.org, vbabka@suse.cz,
Liam.Howlett@oracle.com, broonie@kernel.org,
skhan@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org, jorgelo@chromium.org,
pedro.falcato@gmail.com, rdunlap@infradead.org, jannh@google.com
Subject: Re: [RFC PATCH v1 2/2] mseal: allow noop mprotect
Date: Wed, 12 Mar 2025 09:45:09 -0700 [thread overview]
Message-ID: <202503120931.3BD7A36445@keescook> (raw)
In-Reply-To: <9b3a3ac6-a947-4be2-98b3-c35c195d87ab@lucifer.local>
On Wed, Mar 12, 2025 at 03:50:40PM +0000, Lorenzo Stoakes wrote:
> What about madvise() with MADV_DONTNEED on a r/o VMA that's not faulted in?
> That's a no-op right? But it's not permitted.
Hmm, yes, that's a good example. Thank you!
> So now we have an inconsistency between the two calls.
Yeah, I see your concern now.
> I don't know what you mean by 'ergonomic'?
I was thinking about idempotent-ness. Like, some library setting up a
memory region, it can't call its setup routine twice if the second time
through (where no changes are made) it gets rejected. But I think this
is likely just a userspace problem: check for the VMAs before blindly
trying to do it again. (This is strictly an imagined situation.)
> My reply seemed to get truncated at the end here :) So let me ask again -
> do you have a practical case in mind for this?
Sorry, I didn't have any reply to that part, so I left it off. If Jeff
has a specific case in mind, I'll let him answer that part. :)
-Kees
--
Kees Cook
next prev parent reply other threads:[~2025-03-12 16:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 0:21 [RFC PATCH v1 0/2] " jeffxu
2025-03-12 0:21 ` [RFC PATCH v1 1/2] selftests/mm: mseal_test: avoid using no-op mprotect jeffxu
2025-03-12 0:21 ` [RFC PATCH v1 2/2] mseal: allow noop mprotect jeffxu
2025-03-12 13:49 ` Lorenzo Stoakes
2025-03-12 15:27 ` Kees Cook
2025-03-12 15:48 ` Pedro Falcato
2025-03-12 15:50 ` Lorenzo Stoakes
2025-03-12 16:45 ` Kees Cook [this message]
2025-03-12 23:29 ` Jeff Xu
2025-03-13 5:29 ` Lorenzo Stoakes
2025-03-13 22:50 ` Jeff Xu
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=202503120931.3BD7A36445@keescook \
--to=kees@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=jorgelo@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=lorenzo.stoakes@oracle.com \
--cc=pedro.falcato@gmail.com \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=vbabka@suse.cz \
/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