1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Kernel: Move end_of_kernel_image after the .ksyms section

Without this we won't be able to detect whether .ksyms overlaps the end
of the page table we set up for the kernel image.
This commit is contained in:
Gunnar Beutner 2021-07-16 09:50:34 +02:00 committed by Andreas Kling
parent acf8f2a2a3
commit cbdb488578
5 changed files with 38 additions and 5 deletions

View file

@ -29,6 +29,8 @@ extern FlatPtr start_of_unmap_after_init;
extern FlatPtr end_of_unmap_after_init;
extern FlatPtr start_of_ro_after_init;
extern FlatPtr end_of_ro_after_init;
extern FlatPtr start_of_kernel_ksyms;
extern FlatPtr end_of_kernel_ksyms;
namespace Kernel {
@ -335,6 +337,11 @@ void page_fault_handler(TrapFrame* trap)
PANIC("Attempt to access UNMAP_AFTER_INIT section");
}
if (fault_address >= (FlatPtr)&start_of_kernel_ksyms && fault_address < (FlatPtr)&end_of_kernel_ksyms) {
dump(regs);
PANIC("Attempt to access KSYMS section");
}
PageFault fault { regs.exception_code, VirtualAddress { fault_address } };
auto response = MM.handle_page_fault(fault);