summaryrefslogtreecommitdiff
path: root/Kernel/API
AgeCommit message (Collapse)Author
2020-08-19Kernel: Use Userspace<T> for the recvfrom syscall, and Socket implementationBrian Gianforcaro
This fixes a bunch of unchecked kernel reads and writes, seems like they would might exploitable :). Write of sockaddr_in size to any address you please...
2020-08-19Kernel: Use Userspace<T> for the sendto syscall, and Socket implementationBrian Gianforcaro
Note that the data member is of type ImmutableBufferArgument, which has no Userspace<T> usage. I left it alone for now, to be fixed in a future change holistically for all usages.
2020-08-16AK: Rename KB, MB, GB to KiB, MiB, GiBNico Weber
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
2020-08-15Kernel+LibC+UserspaceEmulator: Bring back sys$dup2()Andreas Kling
This is racy in userspace and non-racy in kernelspace so let's keep it in kernelspace. The behavior change where CLOEXEC is preserved when dup2() is called with (old_fd == new_fd) was good though, let's keep that.
2020-08-15Kernel+LibC+UserspaceEmulator: Remove sys$dup() and sys$dup2()Andreas Kling
We can just implement these in userspace, so yay two less syscalls!
2020-08-12Kernel: Avoid linking errors when calling Kernel APIBen Wiederhake
The compiler can't see that the definitions inside the .h file aren't meant to be public symbols. So in a hypothetical program which uses the Kernel API, each(\!) compilation unit that includes FB.h would define those fb_get_size_in_bytes symbols. If that happens twice or more times, that would cause linker errors. Since the functions are very short, inlining them seems like a good idea. Also, using FB.h should be possible even if the containing compilation unit doesn't already define size_t, so I added that header (stddef), too.
2020-08-11Kernel: Forward declare struct stat in the syscall API headerAndreas Kling
2020-08-10Kernel: Use Userspace<T> for the execve syscallBrian Gianforcaro
2020-08-10Kernel: More PID/TID typingBen Wiederhake
2020-08-07Kernel: Use Userspace<T> for the getsockopt syscall and Socket interfaceBrian Gianforcaro
The way getsockopt is implemented for socket types requires us to push down Userspace<T> using into those interfaces. This change does so, and utilizes proper copy implementations instead of the kind of haphazard pointer dereferencing that was occurring there before.
2020-08-07Kernel: Use Userspace<T> for the setsockopt syscallBrian Gianforcaro
2020-08-07Kernel: Use Userspace<T> for the getsockname syscallBrian Gianforcaro
2020-08-07Kernel: Use Userspace<T> for the getpeername syscallBrian Gianforcaro
2020-08-06Kernel+LibKeyboard: Store the keymap name when setting system keymapValtteri Koskivuori
This way we can query the kernel to see which keymap is currently in use.
2020-08-06Kernel: Partial usage of Userspace<T> for the poll syscallBrian Gianforcaro
This change mostly converts poll to Userspace<T> with the caveat of the fds member of SC_poll_params. It's current usage is a bit too gnarly for me to take on right now, this appears to need a lot more love. In addition to enlightening the syscall to use Userspace<T>, I've also re-worked most of the handling to use validate_read_and_copy instead of just directly de-referencing the user pointer. We also appeared to be missing a re-evaluation of the fds array after the thread block is awoken.
2020-08-05Kernel: Use Userspace<T> for the futex syscallBrian Gianforcaro
Utilizie Userspace<T> for the syscall argument itself, as well as internally in the SC_futex_params struct. We were double validating the SC_futex_params.timeout validation, that was removed as well.
2020-08-05Kernel + LibPthread: Use Userspace<T> in the create_thread syscallBrian Gianforcaro
2020-08-05Kernel: Use Userspace<T> for the waitid syscallBrian Gianforcaro
2020-08-05Kernel: Use Userspace<T> for the clock_nanosleep syscallBrian Gianforcaro
2020-08-04Kernel+LibC: Tidy up sys$ttyname() and sys$ptsname()Andreas Kling
- Remove goofy _r suffix from syscall names. - Don't take a signed buffer size. - Use Userspace<T>. - Make TTY::tty_name() return a String instead of a StringView.
2020-08-04Kernel+LibC: Add sys$disown() for disowning child processesAndreas Kling
This syscall allows a parent process to disown a child process, setting its parent PID to 0. Unparented processes are automatically reaped by the kernel upon exit, and no sys$waitid() is required. This will make it much nicer to do spawn-and-forget which is common in the GUI environment.
2020-08-04Kernel: Tidy up the syscalls list by reorganizing the enumerator macroAndreas Kling
2020-08-02Kernel: Use Userspace<T> in setkeymap syscallBrian Gianforcaro
2020-08-02Kernel: Use Userspace<T> in ptrace syscallBrian Gianforcaro
2020-07-31Kernel: Use Userspace<T> for sys$read() and sys$stat()Andreas Kling
Add validation helper overloads as needed.
2020-07-27Kernel+LibC: Add sys$set_process_name() for changing the process nameAndreas Kling
2020-07-15LibC+Kernel: Start implementing sysconfNico Weber
For now, only the non-standard _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN are implemented. Use them to make ninja pick a better default -j value. While here, make the ninja package script not fail if no other port has been built yet.
2020-07-04Kernel: Move headers intended for userspace use into Kernel/API/Andreas Kling