mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Kernel processes should have IsCritical flag enabled by default
This commit is contained in:
parent
fa4713fdff
commit
69bfc7d9ed
@ -818,8 +818,7 @@ namespace CrashHandler
|
||||
SBIdx = 255;
|
||||
CHArchTrapFrame *Frame = (CHArchTrapFrame *)Data;
|
||||
#if defined(a64)
|
||||
error("-----------------------------------------------------------------------------------");
|
||||
error("An exception occurred!");
|
||||
debug("-----------------------------------------------------------------------------------");
|
||||
error("Exception: %#llx", Frame->InterruptNumber);
|
||||
for (size_t i = 0; i < INT_FRAMES_MAX; i++)
|
||||
EHIntFrames[i] = Interrupts::InterruptFrames[i];
|
||||
@ -834,6 +833,15 @@ namespace CrashHandler
|
||||
debug("Exception in kernel mode (ip: %#lx (%s))",
|
||||
Frame->rip, KernelSymbolTable ? KernelSymbolTable->GetSymbolFromAddress(Frame->rip) : "No symbol");
|
||||
|
||||
CPUData *data = GetCurrentCPU();
|
||||
if (data)
|
||||
{
|
||||
if (!data->CurrentThread->Security.IsCritical)
|
||||
{
|
||||
fixme("Exception in non-critical thread (kernel mode)");
|
||||
}
|
||||
}
|
||||
|
||||
if (TaskManager)
|
||||
TaskManager->Panic();
|
||||
ForceUnlock = true;
|
||||
|
@ -445,6 +445,7 @@ namespace Tasking
|
||||
[[fallthrough]];
|
||||
case TaskTrustLevel::Kernel:
|
||||
{
|
||||
Thread->Security.IsCritical = true;
|
||||
Thread->Stack = new Memory::StackGuard(false, Parent->PageTable);
|
||||
#if defined(a64)
|
||||
SecurityManager.TrustToken(Thread->Security.UniqueToken, TTL::TrustedByKernel);
|
||||
@ -706,6 +707,7 @@ namespace Tasking
|
||||
[[fallthrough]];
|
||||
case TaskTrustLevel::Kernel:
|
||||
{
|
||||
Process->Security.IsCritical = true;
|
||||
SecurityManager.TrustToken(Process->Security.UniqueToken, TTL::TrustedByKernel);
|
||||
#if defined(a64)
|
||||
if (!DoNotCreatePageTable)
|
||||
|
Loading…
x
Reference in New Issue
Block a user