mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Kernel: Mark write_cr0() and write_cr4() as UNMAP_AFTER_INIT
This removes a very useful tool for attackers trying to disable SMAP/SMEP/etc. :^)
This commit is contained in:
parent
6136faa4eb
commit
32e93c8808
1 changed files with 2 additions and 2 deletions
|
@ -720,12 +720,12 @@ void exit_trap(TrapFrame* trap)
|
|||
return Processor::current().exit_trap(*trap);
|
||||
}
|
||||
|
||||
void write_cr0(u32 value)
|
||||
NEVER_INLINE UNMAP_AFTER_INIT void write_cr0(u32 value)
|
||||
{
|
||||
asm volatile("movl %%eax, %%cr0" ::"a"(value));
|
||||
}
|
||||
|
||||
void write_cr4(u32 value)
|
||||
NEVER_INLINE UNMAP_AFTER_INIT void write_cr4(u32 value)
|
||||
{
|
||||
asm volatile("movl %%eax, %%cr4" ::"a"(value));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue