1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:05:10 +00:00

Kernel: Use Process::credentials() and remove user ID/group ID helpers

Move away from using the group ID/user ID helpers in the process to
allow for us to take advantage of the immutable credentials instead.
This commit is contained in:
Anthony Iacono 2022-08-20 18:21:01 -04:00 committed by Andreas Kling
parent 8026d8926c
commit f86b671de2
27 changed files with 109 additions and 94 deletions

View file

@ -1131,7 +1131,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
// Set for SI_TIMER, we don't have the data here.
.si_errno = 0,
.si_pid = sender_pid.value(),
.si_uid = sender ? sender->uid().value() : 0,
.si_uid = sender ? sender->credentials()->uid().value() : 0,
// Set for SIGILL, SIGFPE, SIGSEGV and SIGBUS
// FIXME: We don't generate these signals in a way that can be handled.
.si_addr = 0,
@ -1346,7 +1346,8 @@ static ErrorOr<bool> symbolicate(RecognizedSymbol const& symbol, Process& proces
if (symbol.address == 0)
return false;
bool mask_kernel_addresses = !process.is_superuser();
auto credentials = process.credentials();
bool mask_kernel_addresses = !credentials->is_superuser();
if (!symbol.symbol) {
if (!Memory::is_user_address(VirtualAddress(symbol.address))) {
TRY(builder.try_append("0xdeadc0de\n"sv));