mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:27:42 +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:
parent
dfd759f75a
commit
38f93ef13b
6 changed files with 25 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue