1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix missing validation of program entry points.

This commit is contained in:
Jonas 'Sortie' Termansen 2016-05-17 17:06:14 +02:00
parent b54e09ebaf
commit 1dbd1f760a

View file

@ -123,7 +123,7 @@ uintptr_t Load(const void* file_ptr, size_t file_size, Auxiliary* aux)
if ( header->e_type != ET_EXEC )
return errno = EINVAL, 0;
if ( header->e_entry == 0 )
if ( header->e_entry < userspace_addr || userspace_end <= header->e_entry )
return errno = EINVAL, 0;
if ( file_size < header->e_phoff )