Method and system for detecting kernel corruption exploits
Methods and systems provide for detecting exploitation of kernel vulnerabilities which typically corrupt memory. The methods and systems are implemented, for example, via a host, which includes a hypervisor, which controls the operating system (OS) user space and the OS kernel space.
1. A computerized method for detecting attempts of code execution from memory pages from non-executable memory in a Kernel Space, comprising:
providing a host for a memory system, the memory system comprising a guest user space and a guest kernel space, the host managing a branches buffer for each process operating in the memory system;
writing, by the host, a shadow page table entry (SPTE) for a memory page, the shadow page table entry describing a guest address;
determining that the guest address is a kernel mode address;
determining whether the kernel mode address is an executable kernel address; and,
if the kernel mode address is an executable kernel address, disable a NX bit in the SPTE, so that the code executes; and,
if the kernel mode address is not an executable kernel address, enable the NX bit in the SPTE, so that the code is non-executable.
2. The computerized method of claim 1 , wherein the determining whether the kernel mode address is an executable kernel address is performed by checking the kernel mode address against addresses in a white list.
3. The computerized method of claim 1 , additionally comprising:
when the NX bit in the SPTE has been enabled, determining whether the kernel mode address is a kernel address, and if the kernel mode address is a kernel address which is not a predetermined address, report the kernel mode address as malicious or potentially malicious.
4. The computerized method of claim 3 , wherein predetermined address is provided in a white list.
5. The computerized method of claim 1 , wherein the host includes a hypervisor.