Why is kernel mode callback function poor?

Why does it call callback functions in kernel space from a user-space that is considered "bad" and calls callback functions in user space from user space?

+4
source share
2 answers

Allowing the user to execute code in kernel mode will be a huge security risk. That is, if the user space program is executed in kernel mode, it is not there : the game is completely lost, and the user has full access to everyone and everyone else.

Note that if you are running in kernel mode, virtual memory requests are no longer protected by privilege level. In x86, when in kernel mode you have privilege level 0; which means that you can access anything in physical memory. Thus, if the process callback was executed in kernel space, it could do anything, literally on the machine.

Want to erase all page tables? K. Do you want to see what is in these page tables instead? Do you understand. Do you want to reset the kernel memory and cause the entire system to crash? Lolz is a good idea. Want to hack another process on a machine so that it logs its I / O traffic? Seems legal.

Do not allow the user to run code in kernel space.

+3
source

Source: https://habr.com/ru/post/1658576/


All Articles