#
a9ddc286 |
| 18-Apr-2014 |
guenther <guenther@openbsd.org> |
Have each thread keeps its own (counted!) reference to the process's ucreds to avoid possible use-after-free references when swapping ids in threaded processes. "Do I have the right creds?" checks a
Have each thread keeps its own (counted!) reference to the process's ucreds to avoid possible use-after-free references when swapping ids in threaded processes. "Do I have the right creds?" checks are always made with the threads creds.
Inspired by FreeBSD and NetBSD "right time" deraadt@
show more ...
|
#
665e07d6 |
| 17-Apr-2014 |
guenther <guenther@openbsd.org> |
Make sure the original thread is blocked until any other threads are completely detached from the process before letting it exit, so that sleeping in systrace_exit() doesn't reorder them and lead to
Make sure the original thread is blocked until any other threads are completely detached from the process before letting it exit, so that sleeping in systrace_exit() doesn't reorder them and lead to a panic.
Panic reported by Fabian Raetz (fabian.raetz (at) gmail.com) ok tedu@
show more ...
|
#
d559b8cb |
| 30-Mar-2014 |
guenther <guenther@openbsd.org> |
Eliminates struct pcred by moving the real and saved ugids into struct ucred; struct process then directly links to the ucred
Based on a discussion at c2k10 or so before noting that FreeBSD and NetB
Eliminates struct pcred by moving the real and saved ugids into struct ucred; struct process then directly links to the ucred
Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too.
ok matthew@
show more ...
|
#
8f76f5ad |
| 26-Mar-2014 |
guenther <guenther@openbsd.org> |
Move p_emul and p_sigcode from proc to process. Tweak the handling of ktrace EMUL when changing ktracing: only generate one per process (not one per thread) and pass the correct proc pointer down to
Move p_emul and p_sigcode from proc to process. Tweak the handling of ktrace EMUL when changing ktracing: only generate one per process (not one per thread) and pass the correct proc pointer down to the VFS layer. Permit generating of NAMI and CSW records inside ktrace(2) itself.
ok deraadt@ millert@
show more ...
|
#
533be81a |
| 22-Mar-2014 |
guenther <guenther@openbsd.org> |
Move p_sigacts from struct proc to struct process.
testing help mpi@
|
#
34b8a7e2 |
| 12-Feb-2014 |
guenther <guenther@openbsd.org> |
Eliminate the exit sig handling, which was only invokable via the Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@ confirms Opera runs in compat without this, so out it goes; one
Eliminate the exit sig handling, which was only invokable via the Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@ confirms Opera runs in compat without this, so out it goes; one less hair to choke on in kern_exit.c
ok tedu@ pirofti@
show more ...
|
#
c305c5e9 |
| 09-Feb-2014 |
kettenis <kettenis@openbsd.org> |
Fix the lock order reversal problem in the code that stops traced multi-threaded processes when they receive a signal:
1. Make the parent of the process (the tracer) wait for all threads to be s
Fix the lock order reversal problem in the code that stops traced multi-threaded processes when they receive a signal:
1. Make the parent of the process (the tracer) wait for all threads to be stopped (in wait4(2)) instead of the thread that received the signal. This prevents us from calling tsleep(9) recursively.
2. Assume that we already hold the kernel lock if the P_SINTR flag is set (just like we already assumed we were holding the scheduler lock) and don't try to grab it again.
This should fix the panic that many people reported when debugging multi-threaded programs with gdb(1).
ok & lots of help from guenther@
show more ...
|
#
7f86807e |
| 24-Jan-2014 |
guenther <guenther@openbsd.org> |
exit1() needs to do a final aggregation of the thread's [us]ticks and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage().
problem pointed out by tedu@ ok
exit1() needs to do a final aggregation of the thread's [us]ticks and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage().
problem pointed out by tedu@ ok deraadt@
show more ...
|
#
fdccc843 |
| 21-Jan-2014 |
guenther <guenther@openbsd.org> |
Setting p->p_p to NULL when it's still running isn't safe for statclock(). It was just for cleanliness, so be a little dirty
ok krw@, who managed to convince his clock to fire in the gap
|
#
712e2ef1 |
| 20-Jan-2014 |
guenther <guenther@openbsd.org> |
Threads can't be zombies, only processes, so change zombproc to zombprocess, make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list
Threads can't be zombies, only processes, so change zombproc to zombprocess, make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes.
ok tedu@
show more ...
|
#
4ab8ed70 |
| 20-Jan-2014 |
guenther <guenther@openbsd.org> |
Move p_textvp from struct proc to struct process so that the exit code can be further simplified.
ok kettenis@
|
#
14988649 |
| 25-Oct-2013 |
guenther <guenther@openbsd.org> |
Move the declarations for dogetrusage(), itimerround(), and dowait4() to sys/*.h headers so that the compat/linux code can use them. Change dowait4() to not copyout() the status value, but rather lea
Move the declarations for dogetrusage(), itimerround(), and dowait4() to sys/*.h headers so that the compat/linux code can use them. Change dowait4() to not copyout() the status value, but rather leave that for its caller, as compat/linux has to translate it, with the side benefit of simplifying the native code.
Originally written months ago as part of the time_t work; long memory, prodding, and ok from pirofti@
show more ...
|
#
a554f8d9 |
| 08-Oct-2013 |
guenther <guenther@openbsd.org> |
Fix delivery of SIGPROF and SIGVTALRM to threaded processes by having hardclock() set a flag on the running thread and force AST processing, and then have the thread signal itself from userret().
id
Fix delivery of SIGPROF and SIGVTALRM to threaded processes by having hardclock() set a flag on the running thread and force AST processing, and then have the thread signal itself from userret().
idea and flag names from FreeBSD ok jsing@
show more ...
|
#
1759f769 |
| 14-Sep-2013 |
guenther <guenther@openbsd.org> |
Snapshots for all archs have been built, so remove the T32 code
|
#
91a535ff |
| 13-Aug-2013 |
guenther <guenther@openbsd.org> |
Switch time_t, ino_t, clock_t, and struct kevent's ident and data members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything
Switch time_t, ino_t, clock_t, and struct kevent's ident and data members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME.
Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures.
DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead.
Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
show more ...
|
#
718a8735 |
| 05-Jun-2013 |
tedu <tedu@openbsd.org> |
factor out pid allocation to functions. add a small cache of recently exited pids that won't get recycled. ok deraadt
|
#
5636a1d2 |
| 01-Jun-2013 |
tedu <tedu@openbsd.org> |
some small style changes that are distracting me from seeing a real bug
|
#
dcf14ef9 |
| 07-May-2013 |
guenther <guenther@openbsd.org> |
Merge from FreeBSD, r191313 --------------------------- On the exit of the child process which parent either set SA_NOCLDWAIT or ignored SIGCHLD, unconditionally wake up the parent instead of doing t
Merge from FreeBSD, r191313 --------------------------- On the exit of the child process which parent either set SA_NOCLDWAIT or ignored SIGCHLD, unconditionally wake up the parent instead of doing this only when the child is a last child.
This brings us in line with other U**xes that support SA_NOCLDWAIT. If the parent called waitpid(childpid), then exit of the child should wake up the parent immediately instead of forcing it to wait for all children to exit. ---------------------------
ok tedu@, millert@
show more ...
|
#
7e499281 |
| 06-Apr-2013 |
tedu <tedu@openbsd.org> |
rthreads are always enabled. remove the sysctl. ok deraadt guenther kettenis matthew
|
#
7359b57a |
| 30-Mar-2013 |
tedu <tedu@openbsd.org> |
vrele() is a tricky beast. it can sleep if the refcount hits zero, leaving us with a free type function that isn't atomic. deal with this by erasing any reachable pointers to the vnode first, then fr
vrele() is a tricky beast. it can sleep if the refcount hits zero, leaving us with a free type function that isn't atomic. deal with this by erasing any reachable pointers to the vnode first, then free it. ok deraadt guenther
show more ...
|
#
2f360485 |
| 28-Mar-2013 |
deraadt <deraadt@openbsd.org> |
do not include machine/cpu.h from a .c file; it is the responsibility of .h files to pull it in, if needed ok tedu
|
#
121cb929 |
| 08-Sep-2012 |
kettenis <kettenis@openbsd.org> |
Plug a race where we're trying to kill a traced process while it is aleady exiting. At that point ps_single may point to a proc that's already freed. Since there is no point in killing a process tha
Plug a race where we're trying to kill a traced process while it is aleady exiting. At that point ps_single may point to a proc that's already freed. Since there is no point in killing a process that's already exiting, just skip this step.
ok guenther@
show more ...
|
#
18914fdf |
| 02-Aug-2012 |
guenther <guenther@openbsd.org> |
Apply profiling to all threads instead of just the thread that called profil() by moving P_PROFIL from proc->p_flag to process->ps_flags with matching adjustment in fork1() and exit1()
ok matthew@
|
#
fba5d5c5 |
| 11-Jul-2012 |
guenther <guenther@openbsd.org> |
exit1(EXIT_THREAD) needs to call single_thread_check() so that it can be suspended and/or decrement pr->ps_singlecount if necessary. With that added, the call the other direction needs to use its own
exit1(EXIT_THREAD) needs to call single_thread_check() so that it can be suspended and/or decrement pr->ps_singlecount if necessary. With that added, the call the other direction needs to use its own flag (EXIT_THREAD_NOCHECK) to avoid looping.
problem diagnosed from a hang naddy@ hit; ok kettenis@
show more ...
|
#
7a825137 |
| 09-Jul-2012 |
guenther <guenther@openbsd.org> |
The linux emulation exit hook needs to be able to sleep, so call it before changing p_stat to SDEAD
ok pirofti@
|