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)
|
if (TaskManager)
|
||||||
{
|
{
|
||||||
Tasking::PCB *ParentProcess = TaskManager->GetCurrentProcess();
|
TaskManager->CreateThread(TaskManager->CreateProcess(nullptr,
|
||||||
if (!ParentProcess)
|
"Shutdown",
|
||||||
ParentProcess = GetCPU(0)->CurrentProcess.load();
|
Tasking::TaskTrustLevel::Kernel),
|
||||||
TaskManager->CreateThread(ParentProcess, (Tasking::IP)KST_Shutdown);
|
(Tasking::IP)KST_Shutdown);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
KernelShutdownThread(false);
|
KernelShutdownThread(false);
|
||||||
|
@ -65,7 +65,7 @@ namespace Memory
|
|||||||
this->Size = STACK_SIZE;
|
this->Size = STACK_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
trace("Allocated stack at %p", this->StackBottom);
|
debug("Allocated stack at %p", this->StackBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
StackGuard::~StackGuard()
|
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)
|
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 | Untrusted))
|
||||||
if (!CheckTrust(TrustedByKernel | Trusted))
|
|
||||||
return SYSCALL_ACCESS_DENIED;
|
return SYSCALL_ACCESS_DENIED;
|
||||||
|
|
||||||
switch (Command)
|
switch (Command)
|
||||||
@ -129,6 +128,8 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t
|
|||||||
return TaskManager->GetCurrentThread()->Security.IsCritical;
|
return TaskManager->GetCurrentThread()->Security.IsCritical;
|
||||||
case KCTL_REGISTER_ELF_LIB:
|
case KCTL_REGISTER_ELF_LIB:
|
||||||
{
|
{
|
||||||
|
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||||
|
return SYSCALL_ACCESS_DENIED;
|
||||||
char *Identifier = (char *)Arg1;
|
char *Identifier = (char *)Arg1;
|
||||||
const char *Path = (const char *)Arg2;
|
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:
|
case KCTL_GET_ELF_LIB_FILE:
|
||||||
{
|
{
|
||||||
|
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||||
|
return SYSCALL_ACCESS_DENIED;
|
||||||
char *Identifier = (char *)Arg1;
|
char *Identifier = (char *)Arg1;
|
||||||
if (!Identifier)
|
if (!Identifier)
|
||||||
return 0;
|
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:
|
case KCTL_GET_ELF_LIB_MEMORY_IMAGE:
|
||||||
{
|
{
|
||||||
|
if (!CheckTrust(TrustedByKernel | Trusted))
|
||||||
|
return SYSCALL_ACCESS_DENIED;
|
||||||
char *Identifier = (char *)Arg1;
|
char *Identifier = (char *)Arg1;
|
||||||
if (!Identifier)
|
if (!Identifier)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -61,4 +61,5 @@ extern "C" uintptr_t SystemCallsHandler(SyscallsFrame *Frame)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(false); /* Should never reach here. */
|
assert(false); /* Should never reach here. */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user