mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Kernel: Disable x86 RDTSC instruction in userspace
It's still possible to read the TSC via the read_tsc() syscall, but we will now clear some of the bottom bits for unprivileged users.
This commit is contained in:
@@ -2452,6 +2452,8 @@ int Process::sys$read_tsc(u32* lsw, u32* msw)
|
||||
if (!validate_write_typed(msw))
|
||||
return -EFAULT;
|
||||
read_tsc(*lsw, *msw);
|
||||
if (!is_superuser())
|
||||
*lsw &= ~0xfff;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user