mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Refactor BaseBufferStackError function
This commit is contained in:
parent
740f100843
commit
2d5bb5193d
@ -301,7 +301,7 @@ ExceptionExit:
|
|||||||
ExceptionLock.store(false, std::memory_order_release);
|
ExceptionLock.store(false, std::memory_order_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsa void BaseBufferStackError()
|
nsa void BaseBufferStackError(bool Stack)
|
||||||
{
|
{
|
||||||
/* We don't need to restore the page table
|
/* We don't need to restore the page table
|
||||||
because the ExceptionHandlerStub will
|
because the ExceptionHandlerStub will
|
||||||
@ -326,7 +326,7 @@ nsa void BaseBufferStackError()
|
|||||||
ForceUnlock = true;
|
ForceUnlock = true;
|
||||||
|
|
||||||
debug("-----------------------------------------------------------------------------------");
|
debug("-----------------------------------------------------------------------------------");
|
||||||
error("Buffer overflow detected");
|
error("%s", Stack ? "Stack smashing detected" : "Buffer overflow detected");
|
||||||
debug("%ld MiB / %ld MiB (%ld MiB Reserved)",
|
debug("%ld MiB / %ld MiB (%ld MiB Reserved)",
|
||||||
TO_MiB(KernelAllocator.GetUsedMemory()),
|
TO_MiB(KernelAllocator.GetUsedMemory()),
|
||||||
TO_MiB(KernelAllocator.GetTotalMemory()),
|
TO_MiB(KernelAllocator.GetTotalMemory()),
|
||||||
@ -335,14 +335,14 @@ nsa void BaseBufferStackError()
|
|||||||
|
|
||||||
nsa __noreturn void HandleStackSmashing()
|
nsa __noreturn void HandleStackSmashing()
|
||||||
{
|
{
|
||||||
BaseBufferStackError();
|
BaseBufferStackError(true);
|
||||||
DisplayStackSmashing();
|
DisplayStackSmashing();
|
||||||
CPU::Stop();
|
CPU::Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsa __noreturn void HandleBufferOverflow()
|
nsa __noreturn void HandleBufferOverflow()
|
||||||
{
|
{
|
||||||
BaseBufferStackError();
|
BaseBufferStackError(false);
|
||||||
DisplayBufferOverflow();
|
DisplayBufferOverflow();
|
||||||
CPU::Stop();
|
CPU::Stop();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user