mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Execute only programs with an executable bit set.
This commit is contained in:
parent
9ccfdb9990
commit
4b1079510b
1 changed files with 2 additions and 0 deletions
|
@ -1162,6 +1162,8 @@ int sys_execve_kernel(const char* filename,
|
|||
struct stat st;
|
||||
if ( desc->stat(&ctx, &st) )
|
||||
return -1;
|
||||
if ( !(st.st_mode & 0111) )
|
||||
return errno = EACCES, -1;
|
||||
if ( st.st_size < 0 )
|
||||
return errno = EINVAL, -1;
|
||||
if ( (uintmax_t) SIZE_MAX < (uintmax_t) st.st_size )
|
||||
|
|
Loading…
Reference in a new issue