364 Commits

Author SHA1 Message Date
Theodore Dubois
d6ca8f99a0 Release files retained by poll 2019-01-21 12:21:00 -08:00
Theodore Dubois
088e7b727d Implement ptys
Also a bunch of somewhat related changes, I was too lazy to break this into more than one commit
2019-01-21 12:20:43 -08:00
Theodore Dubois
21a2db30e5 Ignore flags argument to fchmodat, like the kernel does 2019-01-21 11:38:06 -08:00
Theodore Dubois
b4a24b0eb4 Stop ignoring -Winitializer-overrides 2019-01-13 17:30:08 -05:00
Theodore Dubois
cfc2017948 Fix out of bounds write in readlink 2019-01-12 16:49:24 -08:00
Theodore Dubois
0c788b79d9 Improve dump_stack output 2019-01-12 12:47:22 -08:00
Theodore Dubois
7a82537309 Revert "Use a read lock on pagetables while reading/writing user memory"
This reverts commit 230678d93e10f61ca205471ee230eab9a1877b9d.

It was hanging on Linux and I was too lazy to debug lol.
2019-01-11 15:04:54 -08:00
Theodore Dubois
f658d6335b Limit the size of logged execve arguments 2019-01-11 16:58:35 -05:00
Theodore Dubois
ff83d8e267 Fix fd leaks on device nodes 2019-01-11 14:28:29 -05:00
Theodore Dubois
5aeb536d61 Copy all the fields of struct mm 2019-01-10 19:12:12 -05:00
Theodore Dubois
328fc5b4a4 Fix leak of exefile 2019-01-10 10:36:10 -05:00
Theodore Dubois
230678d93e Use a read lock on pagetables while reading/writing user memory 2019-01-10 08:40:35 -05:00
Theodore Dubois
e5ca15aeb2 Make SIGKILL work on a stopped process 2019-01-08 09:24:46 -05:00
Theodore Dubois
842da480bf Correctly handle spurious wakeups in wait4 2019-01-07 11:40:49 -08:00
Theodore Dubois
c14eca8ae7 Fix a couple of segfaults in midnight commander 2019-01-06 17:13:34 -08:00
Theodore Dubois
1265ff32c3 Fix zsh sometimes hanging in sigsuspend 2019-01-06 11:09:26 -08:00
Theodore Dubois
aed7f5fb38 Fix some thread sanitizer warnings 2019-01-06 09:02:31 -08:00
Theodore Dubois
d0d59ac376 Be less woke 2019-01-06 08:05:11 -08:00
Theodore Dubois
89d5b7f69a Resolve -Wsign-compare 2019-01-05 18:11:16 -08:00
Theodore Dubois
1b22ddb9bd Resolve -Wmissing-field-initializers 2019-01-05 17:29:11 -08:00
Theodore Dubois
a0ca767db6 Rewrite syslog buffer to use a generic fifo
Trivia: I wrote this ring buffer implementation in half an hour during a Google interview and it somehow works better than the old one which took me half a day.
2019-01-05 17:24:32 -08:00
Theodore Dubois
032a218a63 Mark unused function arguments 2019-01-05 17:18:54 -08:00
Theodore Dubois
b04f6f1b3b Remove some unnecessary function arguments 2019-01-05 17:18:54 -08:00
Theodore Dubois
a0d2a12f3b Implement /proc/pid/cmdline and /proc/pid/exe 2019-01-04 18:53:17 -08:00
Theodore Dubois
5cfec48854 Separate out some components of struct mem into struct mm 2019-01-04 15:17:37 -08:00
Theodore Dubois
13fb417337 Correctly handle NULL sigset in sigprocmask 2019-01-03 21:15:52 -08:00
Theodore Dubois
923571fe16 Start signal stack at bottom of alternate stack, not top
😀🔫
2019-01-03 18:04:15 -08:00
Theodore Dubois
8eb4b800a5 Implement /proc/pid/fd, /proc/self 2019-01-03 13:50:08 -08:00
Theodore Dubois
137e1a2814 Overhaul fdtable implementation to add locking 2019-01-02 21:50:25 -08:00
Theodore Dubois
a4c09fb0ce Add strace for sigpending 2019-01-02 20:02:19 -08:00
Theodore Dubois
5530f3f577 Implement sigpending 2019-01-02 19:45:06 -08:00
Theodore Dubois
571e28eaa9 Fix a typo in getres[ug]id 2019-01-02 19:21:43 -08:00
Theodore Dubois
97756cb34c Save the euid/egid when executing a setuid/setgid program 2019-01-02 19:21:25 -08:00
Theodore Dubois
1da3faacd4 Handle setuid and setgid programs 2019-01-02 18:58:16 -08:00
Theodore Dubois
bbf1eb46f5 Clear task->vfork before sys_clone returns 2019-01-01 15:08:04 -08:00
Theodore Dubois
6406cf3719 Fix condition static initializer 2019-01-01 13:14:40 -08:00
Theodore Dubois
8478bf5b53 Implement stopping processes with signals 2019-01-01 12:54:26 -08:00
Theodore Dubois
6a0f7253db Fix locking on children_rusage in reap_if_zombie 2019-01-01 12:31:42 -08:00
Theodore Dubois
1e3319c242 Don't return ECHILD from waitpid(-1) if there are children 2018-12-31 19:38:00 -08:00
Theodore Dubois
09d3885c70 Remove useless has_timer field 2018-12-31 18:03:29 -08:00
Theodore Dubois
610e9a8295 Refactor exit management code 2018-12-31 18:03:20 -08:00
Theodore Dubois
6dca791a13 Fix memory leak of timers 2018-12-31 17:30:10 -08:00
Theodore Dubois
14d30a35df Fix potential UAF when handling CLONE_VFORK 2018-12-31 17:29:36 -08:00
Theodore Dubois
3b7c92d141 Implement sigsuspend
Fixes zsh (#103)
2018-12-30 21:19:46 -08:00
Theodore Dubois
ac422754ce Improve dump_stack output 2018-12-30 21:19:22 -08:00
Theodore Dubois
eb87fe2a64 Make sure the strace output from exit actually appears 2018-12-30 21:19:03 -08:00
Theodore Dubois
87adcbc176 Handle errors in opening a shell script interpreter 2018-12-30 20:28:11 -08:00
Theodore Dubois
5c135f4a88 Unbreak ssh (fixes #224) 2018-12-27 20:57:06 -08:00
Theodore Dubois
7f48c0e806 Stub copy_file_range 2018-12-27 20:21:07 -08:00
Theodore Dubois
da72010be3 Implement getres[ug]id 2018-12-27 20:21:01 -08:00