Messages in this thread | | | Date | Wed, 24 Aug 2022 09:28:17 -0700 | Subject | Re: PKU usage improvements for threads | From | Dave Hansen <> |
| |
On 8/24/22 01:51, Stephen Röttger wrote: >>> Yeah, that's something for which our defenses are quite weak. But, it >>> also calls for a very generic mm/ solution and not something specific at >>> all to pkeys. > We were also thinking about if this should be a more generic feature instead of > being tied to pkeys. I.e. the doc above has an alternative proposal to introduce > something like a memory seal/unseal syscall. > I was personally leaning towards using pkeys for this for a few reasons: > * intuitively it would make sense to me to extend PKEY_DISABLE_ACCESS > to also mean disable all changes to the memory, not just the data.
It would make some sense, but we can't do it with the existing PKEY_DISABLE_ACCESS ABI. It would surely break existing users if they couldn't munmap() memory that was PKEY_DISABLE_ACCESS.
But, making it part of the mprotect() ABI wouldn't be the worst thing in the world. Since we have a pkey_mprotect(), any mprotect()-based mechanism could even reuse the existing pkey syscalls.
I do agree with Andy, though, that I'm not quite sure what the attack model is here. If an attacker can make arbitrary system calls, surely protecting one little altstack VMA isn't doing to help much.
| |