[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202503120931.3BD7A36445@keescook>
Date: Wed, 12 Mar 2025 09:45:09 -0700
From: Kees Cook <kees@...nel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: jeffxu@...omium.org, akpm@...ux-foundation.org, vbabka@...e.cz,
Liam.Howlett@...cle.com, broonie@...nel.org,
skhan@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-mm@...ck.org, jorgelo@...omium.org, pedro.falcato@...il.com,
rdunlap@...radead.org, jannh@...gle.com
Subject: Re: [RFC PATCH v1 2/2] mseal: allow noop mprotect
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
Powered by blists - more mailing lists