diff --git a/src/system/kernel/arch/riscv64/RISCV64VMTranslationMap.cpp b/src/system/kernel/arch/riscv64/RISCV64VMTranslationMap.cpp index 4b1cf16570..b00e98bda2 100644 --- a/src/system/kernel/arch/riscv64/RISCV64VMTranslationMap.cpp +++ b/src/system/kernel/arch/riscv64/RISCV64VMTranslationMap.cpp @@ -327,8 +327,10 @@ RISCV64VMTranslationMap::Map(addr_t virtualAddress, phys_addr_t physicalAddress, newPte.flags |= (1 << pteRead); if ((attributes & B_WRITE_AREA) != 0) newPte.flags |= (1 << pteWrite); - if ((attributes & B_EXECUTE_AREA) != 0) + if ((attributes & B_EXECUTE_AREA) != 0) { newPte.flags |= (1 << pteExec); + fInvalidCode = true; + } } else { if ((attributes & B_KERNEL_READ_AREA) != 0) newPte.flags |= (1 << pteRead);