Kernel: Fix possible crash during exec

This commit is contained in:
Bananymous 2025-08-26 20:11:18 +03:00
parent 706cfeb443
commit cea19ecc31
1 changed files with 5 additions and 0 deletions

View File

@ -717,6 +717,11 @@ namespace Kernel
new_thread->set_tls(tls_result.addr);
}
// NOTE: this is done before disabling interrupts and moving the threads as
// shared filebacked mmap can write to disk on on clearing, this will lock
// filesystem mutex which can yield
m_mapped_regions.clear();
ASSERT(Processor::get_interrupt_state() == InterruptState::Enabled);
Processor::set_interrupt_state(InterruptState::Disabled);