mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +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
Notes:
sideshowbarker
2024-07-19 10:28:41 +09:00
Author: https://github.com/awesomekling
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