Kernel: Tolerate cloning MAP_STACK regions that are PROT_NONE

There's nothing stopping a userspace program from keeping a bunch of
threads around with a custom signal stack in a suspended state with
their normal thread stack mprotected to PROT_NONE.

OpenJDK seems to do this, for example.
This commit is contained in:
Andrew Kaster 2022-06-12 23:11:43 -06:00 committed by Andreas Kling
parent 940be19259
commit 1d3b5d330d
Notes: sideshowbarker 2024-07-17 10:05:00 +09:00

View file

@ -129,8 +129,6 @@ ErrorOr<NonnullOwnPtr<Region>> Region::try_clone()
m_range, move(vmobject_clone), m_offset_in_vmobject, move(clone_region_name), access(), m_cacheable ? Cacheable::Yes : Cacheable::No, m_shared));
if (m_stack) {
VERIFY(is_readable());
VERIFY(is_writable());
VERIFY(vmobject().is_anonymous());
clone_region->set_stack(true);
}