1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

UserspaceEmulator: Mark the full initial TCB as initialized memory

This commit is contained in:
Andreas Kling 2020-07-21 16:27:54 +02:00
parent 685e006e27
commit 903c5b0833

View file

@ -118,7 +118,7 @@ bool Emulator::load_elf()
if (program_header.type() == PT_TLS) {
auto tcb_region = make<SimpleRegion>(0x20000000, program_header.size_in_memory());
memcpy(tcb_region->data(), program_header.raw_data(), program_header.size_in_image());
memset(tcb_region->shadow_data(), 0x01, program_header.size_in_image());
memset(tcb_region->shadow_data(), 0x01, program_header.size_in_memory());
auto tls_region = make<SimpleRegion>(0, 4);
tls_region->write32(0, shadow_wrap_as_initialized(tcb_region->base() + 8));