mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
Kernel: Fixed argument passing for profiling_enable syscall
Arguments larger than 32bit need to be passed as a pointer on a 32bit architectures. sys$profiling_enable has u64 event_mask argument, which means that it needs to be passed as an pointer. Previously upper 32bits were filled by garbage.
This commit is contained in:
parent
0f2e18403c
commit
895a050e04
4 changed files with 9 additions and 4 deletions
|
@ -16,11 +16,15 @@ bool g_profiling_all_threads;
|
|||
PerformanceEventBuffer* g_global_perf_events;
|
||||
u64 g_profiling_event_mask;
|
||||
|
||||
ErrorOr<FlatPtr> Process::sys$profiling_enable(pid_t pid, u64 event_mask)
|
||||
// NOTE: event_mask needs to be passed as a pointer as u64
|
||||
// does not fit into a register on 32bit architectures.
|
||||
ErrorOr<FlatPtr> Process::sys$profiling_enable(pid_t pid, Userspace<u64 const*> userspace_event_mask)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
TRY(require_no_promises());
|
||||
|
||||
const auto event_mask = TRY(copy_typed_from_user(userspace_event_mask));
|
||||
|
||||
if (pid == -1) {
|
||||
if (!is_superuser())
|
||||
return EPERM;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue