mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 23:14:38 +00:00
Bug fixes
This commit is contained in:
parent
299c919d1d
commit
c1eaabf97b
@ -80,10 +80,10 @@ namespace ACPI
|
||||
{
|
||||
if (TaskManager)
|
||||
{
|
||||
Tasking::PCB *ParentProcess = TaskManager->GetCurrentProcess();
|
||||
if (!ParentProcess)
|
||||
ParentProcess = GetCPU(0)->CurrentProcess.load();
|
||||
TaskManager->CreateThread(ParentProcess, (Tasking::IP)KST_Shutdown);
|
||||
TaskManager->CreateThread(TaskManager->CreateProcess(nullptr,
|
||||
"Shutdown",
|
||||
Tasking::TaskTrustLevel::Kernel),
|
||||
(Tasking::IP)KST_Shutdown);
|
||||
}
|
||||
else
|
||||
KernelShutdownThread(false);
|
||||
|
@ -65,7 +65,7 @@ namespace Memory
|
||||
this->Size = STACK_SIZE;
|
||||
}
|
||||
|
||||
trace("Allocated stack at %p", this->StackBottom);
|
||||
debug("Allocated stack at %p", this->StackBottom);
|
||||
}
|
||||
|
||||
StackGuard::~StackGuard()
|
||||
|
@ -113,8 +113,7 @@ static int sys_detach_address(SyscallsFrame *Frame, uintptr_t Address)
|
||||
|
||||
static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t Arg1, uint64_t Arg2, uint64_t Arg3, uint64_t Arg4)
|
||||
{
|
||||
/* Only trusted threads can use kernelctl */
|
||||
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||
if (!CheckTrust(TrustedByKernel | Trusted | Untrusted))
|
||||
return SYSCALL_ACCESS_DENIED;
|
||||
|
||||
switch (Command)
|
||||
@ -129,6 +128,8 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t
|
||||
return TaskManager->GetCurrentThread()->Security.IsCritical;
|
||||
case KCTL_REGISTER_ELF_LIB:
|
||||
{
|
||||
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||
return SYSCALL_ACCESS_DENIED;
|
||||
char *Identifier = (char *)Arg1;
|
||||
const char *Path = (const char *)Arg2;
|
||||
|
||||
@ -180,6 +181,8 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t
|
||||
}
|
||||
case KCTL_GET_ELF_LIB_FILE:
|
||||
{
|
||||
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||
return SYSCALL_ACCESS_DENIED;
|
||||
char *Identifier = (char *)Arg1;
|
||||
if (!Identifier)
|
||||
return 0;
|
||||
@ -195,6 +198,8 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t
|
||||
}
|
||||
case KCTL_GET_ELF_LIB_MEMORY_IMAGE:
|
||||
{
|
||||
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||
return SYSCALL_ACCESS_DENIED;
|
||||
char *Identifier = (char *)Arg1;
|
||||
if (!Identifier)
|
||||
return 0;
|
||||
|
@ -61,4 +61,5 @@ extern "C" uintptr_t SystemCallsHandler(SyscallsFrame *Frame)
|
||||
}
|
||||
}
|
||||
assert(false); /* Should never reach here. */
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user