forked from Bananymous/banan-os
Kernel: Validate pointer's when printing stack trace
There was an kernel panic if stack trace contained uncanonical addresses.
This commit is contained in:
parent
ae89237453
commit
57aec2a733
|
@ -41,6 +41,12 @@ namespace Debug
|
|||
BAN::Formatter::print(Debug::putchar, "\e[36mStack trace:\r\n");
|
||||
while (frame)
|
||||
{
|
||||
if (!PageTable::is_valid_pointer((vaddr_t)frame))
|
||||
{
|
||||
derrorln("invalid pointer {H}", (vaddr_t)frame);
|
||||
break;
|
||||
}
|
||||
|
||||
if (PageTable::current().is_page_free((vaddr_t)frame & PAGE_ADDR_MASK))
|
||||
{
|
||||
derrorln(" {} not mapped", frame);
|
||||
|
|
Loading…
Reference in New Issue