ladybird/Kernel/Syscalls
Brian Gianforcaro 54b9a4ec1e Kernel: Handle promise violations in the syscall handler
Previously we would crash the process immediately when a promise
violation was found during a syscall. This is error prone, as we
don't unwind the stack. This means that in certain cases we can
leak resources, like an OwnPtr / RefPtr tracked on the stack. Or
even leak a lock acquired in a ScopeLockLocker.

To remedy this situation we move the promise violation handling to
the syscall handler, right before we return to user space. This
allows the code to follow the normal unwind path, and grantees
there is no longer any cleanup that needs to occur.

The Process::require_promise() and Process::require_no_promises()
functions were modified to return ErrorOr<void> so we enforce that
the errors are always propagated by the caller.
2021-12-29 18:08:15 +01:00
..
access.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
alarm.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
anon_create.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
beep.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
chdir.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
chmod.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
chown.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
clock.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
debug.cpp Kernel+UE+LibC: Remove unused dbgputch syscall 2021-11-24 22:56:39 +01:00
disown.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
dup2.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
emuctl.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
execve.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
exit.cpp Kernel: Fix a few typos 2021-10-01 00:51:49 +01:00
fcntl.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
fork.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
fsync.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
ftruncate.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
futex.cpp Kernel: Fix futex syscall return values 2021-11-24 19:44:57 +01:00
get_dir_entries.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
get_stack_bounds.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
getrandom.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
getuid.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
hostname.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
inode_watcher.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
ioctl.cpp Kernel: Use copy_typed_from_user() in more places :^) 2021-12-18 11:30:10 +01:00
keymap.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
kill.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
link.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
lseek.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
mkdir.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
mknod.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
mmap.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
mount.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
open.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
perf_event.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
pipe.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
pledge.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
poll.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
prctl.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
process.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
profiling.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
ptrace.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
purge.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
read.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
readlink.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
realpath.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
rename.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
rmdir.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
sched.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
sendfd.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
setpgid.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
setuid.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
sigaction.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
socket.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
stat.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
statvfs.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
sync.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
sysconf.cpp Kernel: Return the actual number of CPU cores that we have 2021-12-29 03:17:41 -08:00
thread.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
times.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
ttyname.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
umask.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
uname.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
unlink.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
unveil.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
utime.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
waitid.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00
write.cpp Kernel: Handle promise violations in the syscall handler 2021-12-29 18:08:15 +01:00