Skip to content

Commit 6d44a7f

Browse files
Remove elf_offset check when executing a file (#3)
Remove the elf_offset check from file_execute to allow executing files that have page aligned sections.
1 parent e4e4567 commit 6d44a7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/src/fileManager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ uint8_t file_execute(char* filepath){
182182
uint32_t elf_offset = *( (uint32_t*)( buffer + 0x38 ) );
183183
uint32_t elf_filesize = *( (uint32_t*)( buffer + 0x44 ) );
184184
uint32_t elf_memsz = *( (uint32_t*)( buffer + 0x48 ) );
185-
if( (elf_vaddr>0x5FF000) || (elf_vaddr<0x400000) || (elf_offset>0x130) || (elf_filesize>0xF0000) ) return 0;
185+
if( (elf_vaddr>0x5FF000) || (elf_vaddr<0x400000) || (elf_filesize>0xF0000) ) return 0;
186186
if( (elf_offset + elf_filesize) > file_inst.size ) return 0;
187187

188188
page_directory_t* pd = paging_createPageDirectory();

0 commit comments

Comments
 (0)