Skip to content

Commit 3687b21

Browse files
author
Diego Ferrari
committed
[TALLOC] fix for kernel overflow
1 parent 6755d48 commit 3687b21

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

kernel/memory/talloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "talloc.h"
2+
#include "sysregs.h"
23
#include "types.h"
34
#include "exceptions/exception_handler.h"
45
#include "console/kio.h"
@@ -73,7 +74,7 @@ uint64_t talloc(uint64_t size) {
7374
curr = &(*curr)->next;
7475
}
7576

76-
if (next_free_temp_memory + size > (uintptr_t)&heap_limit) {
77+
if (next_free_temp_memory + size > VIRT_TO_PHYS((uintptr_t)&heap_limit)) {
7778
panic("Kernel allocator overflow", next_free_temp_memory);
7879
}
7980

kernel/process/loading/elf_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void get_elf_debug_info(process_t* proc, void* file, size_t filesize){
6262
return;
6363
}
6464

65+
//TODO: use segments for loading, sections for linking
6566
elf_section_header *sections = (elf_section_header*)(file + header->section_header_offset);
6667

6768
sizedptr debug_line = {};

0 commit comments

Comments
 (0)