On Wed, Oct 18, 2023 at 8:17 AM Matthew Wilcox willy@infradead.org wrote:
Let's start with the purpose. The point of mimmutable/mseal/whatever is to fix the mapping of an address range to its underlying object, be it a particular file mapping or anonymous memory. After the call succeeds, it must not be possible to make any address in that virtual range point into any other object.
The secondary purpose is to lock down permissions on that range. Possibly to fix them where they are, possibly to allow RW->RO transitions.
With those purposes in mind, you should be able to deduce for any syscall or any madvise(), ... whether it should be allowed.
I got it.
IMO: The approaches mimmutable() and mseal() took are different, but we all want to seal the memory from attackers and make the linux application safer.
mimmutable() started with "none of updates to the sealed address is allowed once marked as immutable", this includes from within kernel space including driver, or any new syscalls. It is reasonable to me.
mseal() starts with 4 syscalls from userspace, which is just a way (among many other ways) to demo what memory operation can be sealed, which happens to meet what Chome wants. This is an RFC, I appreciate your input.
Best regards, -Jeff