serenity/Kernel/Syscalls
Liav A. fdf3e0aca1 Kernel: Don't assume sizes of needed buffers early in the execve syscall
Instead, start by trying to read a buffer with size of Elf_Ehdr, and
check it for the shebang sign. If it's indeed an executable with shebang
then read again from the file, now with PAGE_SIZE size, which should
suffice for finding the interpreter path.

However, if the executable is an ELF, we quickly validate it and then
pass the preliminary buffer to the find_elf_interpreter_for_executable
method.

That method calculates the last byte offset which is needed to read all
of the program headers, so we don't just assume 4096 bytes is sufficient
anymore. The same pattern is applied when loading the interpreter ELF
main header and its program headers.
2024-09-01 20:52:55 +02:00
..
alarm.cpp
anon_create.cpp
chdir.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
chmod.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
chown.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
clock.cpp
debug.cpp
disown.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
dup2.cpp
emuctl.cpp
execve.cpp Kernel: Don't assume sizes of needed buffers early in the execve syscall 2024-09-01 20:52:55 +02:00
exit.cpp
faccessat.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
fallocate.cpp
fcntl.cpp
fork.cpp Kernel: Introduce the HostnameContext class 2024-07-21 11:44:23 +02:00
fsync.cpp
ftruncate.cpp
futex.cpp
get_dir_entries.cpp
get_stack_bounds.cpp
getrandom.cpp
getuid.cpp
hostname.cpp Kernel: Introduce the HostnameContext class 2024-07-21 11:44:23 +02:00
inode_watcher.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
ioctl.cpp Kernel: Mark sys$ioctl as not needing the big process lock 2023-12-26 19:20:21 +01:00
keymap.cpp
kill.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
link.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
lseek.cpp
mkdir.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
mknod.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
mmap.cpp Kernel+Userland: Reject W->X prot region transition after a prctl call 2024-05-14 12:41:51 -06:00
mount.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
open.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
perf_event.cpp
pipe.cpp
pledge.cpp
poll.cpp
prctl.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
process.cpp
profiled_syscalls.cpp
profiling.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
ptrace.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
purge.cpp
read.cpp
readlink.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
realpath.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
rename.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
resource.cpp
rmdir.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
sched.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
sendfd.cpp
setpgid.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
setuid.cpp
sigaction.cpp Kernel: Shrink instead of expand sigaltstack range to page boundaries 2023-12-24 16:11:35 +01:00
socket.cpp Kernel: Don't try to copy empty Vector in sys$recvmsg 2024-04-19 16:38:55 -04:00
stat.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
statvfs.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
sync.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
SyscallHandler.cpp Everywhere: Use east const in more places 2024-04-19 06:31:19 -04:00
sysconf.cpp Kernel: Add new sysconf option _SC_GETGR_R_SIZE_MAX 2024-01-06 04:59:50 -07:00
thread.cpp Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
times.cpp
umask.cpp
uname.cpp Kernel: Introduce the HostnameContext class 2024-07-21 11:44:23 +02:00
unlink.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
unshare.cpp Kernel: Introduce the unshare syscall family 2024-07-21 11:44:23 +02:00
unveil.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
utime.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
utimensat.cpp Kernel: Move most of VirtualFileSystem code to be in a namespace 2024-07-21 11:44:23 +02:00
waitid.cpp Kernel+Userland: Reduce jails to be a simple boolean flag 2024-07-21 11:44:23 +02:00
write.cpp