Page 1 of 1

The Linux kernel high mapping is not safe enough?

Posted: Mon Jun 22, 2020 4:02 am
by kingwah
In the source codes of Linux kernel 3.10.0, I have noticed that the virtual address range [__START_KERNEL_map, __START_KERNEL_map+size] is mapped to the physical address range [phys_base, phys_base+size], where size = _end-_text is the size of the kernel image, and phys_base is the delta between the address kernel is actually running at and the address kernel is compiled to run at. But from "arch/x86/kernel/vmlinux.lds.S", the virtual address range compiled for the kernel image is [__START_KERNEL, __START_KERNEL+size], where __START_KERNEL = __START_KERNEL_map + __PHYSICAL_START, so when we want to access symbols within the virtual address range (__START_KERNEL_map+size, __START_KERNEL+size], it would break because there is no page table entries for this?