summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
AgeCommit message (Collapse)Author
2020-08-19Kernel: Distinguish between new and old process groups with equal pgidsAnotherTest
This does not add any behaviour change to the processes, but it ties a TTY to an active process group via TIOCSPGRP, and returns the TTY to the kernel when all processes in the process group die. Also makes the TTY keep a link to the original controlling process' parent (for SIGCHLD) instead of the process itself.
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-17Kernel: Bump process thread count to a 32-bit valueAndreas Kling
We should support more than 65535 threads, after all. :^)
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-10Kernel: Use Userspace<T> for the exit_thread syscallBrian Gianforcaro
Userspace<void*> is a bit strange here, as it would appear to the user that we intend to de-refrence the pointer in kernel mode. However I think it does a good join of illustrating that we are treating the void* as a value type, instead of a pointer type.
2020-08-10Kernel: Use Userspace<T> for the join_thread syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the chroot syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the module_unload syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the module_load syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the getrandom syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the shbuf_get syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the get_thread_name syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the set_thread_name syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the connect syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the accept syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the bind syscall, and implementationBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the chmod syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the umount syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the unlink syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the sigpending syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the sigprocmask syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the fstat syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the uname syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the sethostname syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the gethostname syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the clock_settime syscallBrian Gianforcaro
2020-08-10Kernel: Modifiy clock_settime timespec argument to constBrian Gianforcaro
The timeppec paramter is read only, and should be const.
2020-08-10Kernel: Use Userspace<T> for the clock_gettime syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the getresgid syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the getresuid syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the times syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the getgroups syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the setgroups syscallBrian Gianforcaro
2020-08-10Kernel: Use Userspace<T> for the execve syscallBrian Gianforcaro
2020-08-10Kernel: More PID/TID typingBen Wiederhake
2020-08-10Kernel: PID/PGID typingBen Wiederhake
This compiles, and fixes two bugs: - setpgid() confusion (see previous commit) - tcsetpgrp() now allows to set a non-empty process group even if the group leader has already died. This makes Serenity slightly more POSIX-compatible.
2020-08-10Kernel: PID/TID typingBen Wiederhake
This compiles, and contains exactly the same bugs as before. The regex 'FIXME: PID/' should reveal all markers that I left behind, including: - Incomplete conversion - Issues or things that look fishy - Actual bugs that will go wrong during runtime
2020-08-07Kernel: Use Userspace<T> for the realpath syscallBrian Gianforcaro
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-07Kernel: Use Userspace<T> for the chown syscallBrian Gianforcaro
2020-08-07Kernel: Use Userspace<T> for the mount syscallBrian Gianforcaro
2020-08-06Kernel: Store TTY's foreground process as a WeakPtr<Process>Andreas Kling
This ensures that we don't leave a stale PGID assigned to the TTY after the process exits, which would make PID recycling attacks possible.
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