mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +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
Notes:
sideshowbarker
2024-07-18 22:08:53 +09:00
Author: https://github.com/awesomekling
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);
|
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));
|
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));
|
asm volatile("movl %%eax, %%cr4" ::"a"(value));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue