Is there any difference between kernel space & user space MEMORY ALLOCATIONS?
From which region of memory they get allocated.
Can anyone please provide some pointers on this?
Thanks.
Best Regards,
Sandeep Singh
Is there any difference between kernel space & user space MEMORY ALLOCATIONS?
From which region of memory they get allocated.
Can anyone please provide some pointers on this?
Thanks.
Best Regards,
Sandeep Singh
The memory regions for both the regions are governed by the respective address-space ranges. The boundary value is stored in the fence register.
User and kernel memory does have differences: in the sense of having different physical attributes tagged to it:
But for allocation algorithm itself: userspace memory is always falling back on kernel memory for its ultimate implementation.
And because kernel mode memory is so much more powerful than usermode, there is a hardware mechanism called SMEP to prevent executing usermode memory from inside kernel mode:
https://www.ncsi.com/nsatc11/presentations/wednesday/emerging_technologies/fischer.pdf
And hardware features like NX bit is always controlled from the kernel mode (ring 0): as a normal user (ring 3) you will not be able to access the bit.
More hardware features:
http://hypervsir.blogspot.sg/2014/11/page-structure-table-corruption-attacks.html