mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
Kernel: Mask kernel addresses in perf event streams for non-superuser
We now turn kernel addresses into 0xdeadc0de, same as /proc/PID/stacks/
This commit is contained in:
parent
369c7a7e9f
commit
1cdc7aa038
1 changed files with 4 additions and 1 deletions
|
@ -286,7 +286,10 @@ ErrorOr<void> PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
|||
seen_first_sample = true;
|
||||
auto stack_array = event_object.add_array("stack");
|
||||
for (size_t j = 0; j < event.stack_size; ++j) {
|
||||
stack_array.add(event.stack[j]);
|
||||
auto address = event.stack[j];
|
||||
if (!show_kernel_addresses && !Memory::is_user_address(VirtualAddress { address }))
|
||||
address = 0xdeadc0de;
|
||||
stack_array.add(address);
|
||||
}
|
||||
stack_array.finish();
|
||||
event_object.finish();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue