plan9fox/sys
cinap_lenrek 4a80d9d029 kernel: fix multiple devproc bugs and pid reuse issues
devproc assumes that when we hold the Proc.debug qlock,
the process will be prevented from exiting. but there is
another race where the process has already exited and
the Proc* slot gets reused. to solve this, on process
creation we also have to acquire the debug qlock while
initializing the fields of the process. this also means
newproc() should only initialize fields *not* protected
by the debug qlock.

always acquire the Proc.debug qlock when changing strings
in the proc structure to avoid doublefree on concurrent
update. for changing the user string, we add a procsetuser()
function that does this for auth.c and devcap.

remove pgrpnote() from pgrp.c and replace by static
postnotepg() in devproc.

avoid the assumption that the Proc* entries returned by
proctab() are continuous.

fixed devproc permission issues:
	- make sure only eve can access /proc/trace
	- none should only be allowed to read its own /proc/n/text
	- move Proc.kp checks into procopen()

pid reuse was not handled correctly, as we where only
checking if a pid had a living process, but there still
could be processes expecting a particular parentpid or
noteid.

this is now addressed with reference counted Pid
structures which are organized in a hash table.
read access to the hash table does not require locks
which will be usefull for dtracy later.
2020-02-23 18:00:21 +01:00
..
doc
games/lib add games/linden and games/turtle 2019-11-03 13:49:23 +00:00
include remove C99_SPRINTF_EXTENSION define. 2020-02-10 19:26:39 -08:00
lib /sys/lib/kbmap: update 0xf860 to Kshift value, fix fake shifts on esc1 2020-02-23 00:57:05 +01:00
man image(6): fix typo 2020-02-04 21:32:33 +01:00
src kernel: fix multiple devproc bugs and pid reuse issues 2020-02-23 18:00:21 +01:00