ladybird/Kernel/Syscalls
Daniel Bertalan b9f30c6f2a Everywhere: Fix some alignment issues
When creating uninitialized storage for variables, we need to make sure
that the alignment is correct. Fixes a KUBSAN failure when running
kernels compiled with Clang.

In `Syscalls/socket.cpp`, we can simply use local variables, as
`sockaddr_un` is a POD type.

Along with moving the `alignas` specifier to the correct member,
`AK::Optional`'s internal buffer has been made non-zeroed by default.
GCC emitted bogus uninitialized memory access warnings, so we now use
`__builtin_launder` to tell the compiler that we know what we are doing.
This might disable some optimizations, but judging by how GCC failed to
notice that the memory's initialization is dependent on `m_has_value`,
I'm not sure that's a bad thing.
2021-07-03 01:56:31 +04:30
..
access.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
alarm.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
anon_create.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
beep.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
chdir.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
chmod.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
chown.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
chroot.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
clock.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
debug.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
disown.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
dup2.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
emuctl.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
execve.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
exit.cpp Kernel: Don't log profile data before/after the process/thread lifetime 2021-05-30 19:03:03 +02:00
fcntl.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
fork.cpp Kernel: Introduce the new ProcFS design 2021-06-29 20:53:59 +02:00
ftruncate.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
futex.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
get_dir_entries.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
get_stack_bounds.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
getrandom.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
getuid.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
hostname.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
inode_watcher.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
ioctl.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
keymap.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
kill.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
link.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
lseek.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
mkdir.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
mknod.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
mmap.cpp Kernel: Disable __thread and TLS on x86_64 for now 2021-06-30 15:13:30 +02:00
module.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
mount.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
open.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
perf_event.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
pipe.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
pledge.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
prctl.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
process.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
profiling.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
ptrace.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
purge.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
read.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
readlink.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
realpath.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
rename.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
rmdir.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
sched.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
select.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
sendfd.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
setpgid.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
setuid.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
shutdown.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
sigaction.cpp Kernel: Implement signal handling for x86_64 2021-06-29 20:03:36 +02:00
socket.cpp Everywhere: Fix some alignment issues 2021-07-03 01:56:31 +04:30
stat.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
statvfs.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
sync.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
sysconf.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
thread.cpp Kernel+LibPthread: Add support for usermode threads on x86_64 2021-07-01 17:22:22 +02:00
times.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
ttyname.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00
umask.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
uname.cpp Kernel: Report correct architecture for uname() 2021-06-29 20:03:36 +02:00
unlink.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
unveil.cpp AK+Everywhere: Use mostly StringView in LexicalPath 2021-06-30 11:13:54 +02:00
utime.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
waitid.cpp Kernel: Fix the return type for syscalls 2021-06-28 22:29:28 +02:00
write.cpp Kernel: Don't copy a Vector<FileDescriptionAndFlags> 2021-06-29 20:53:59 +02:00