1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00

Kernel: Don't ignore validation result in ptrace(PT_PEEK)

Also mark all of the address validation functions [[nodiscard]] to turn
this kind of bug into a compile error in the future.
This commit is contained in:
Andreas Kling 2020-04-13 22:40:38 +02:00
parent e432a27676
commit c8edcf1d71
Notes: sideshowbarker 2024-07-19 07:37:31 +09:00
2 changed files with 12 additions and 11 deletions

View file

@ -113,7 +113,8 @@ KResultOr<u32> handle_syscall(const Kernel::Syscall::SC_ptrace_params& params, P
auto result = peer->process().peek_user_data(peek_params.address);
if (result.is_error())
return -EFAULT;
peer->process().validate_write(peek_params.out_data, sizeof(u32));
if (!peer->process().validate_write(peek_params.out_data, sizeof(u32)))
return -EFAULT;
copy_from_user(peek_params.out_data, &result.value());
break;
}