#
07d26032 |
| 22-Oct-2024 |
claudio <claudio@openbsd.org> |
Protect the ps_pgrp pointer by either the KERNEL_LOCK or the ps_mtx.
This should be enough to be on the safe side when unlocking ptsignal where a pr->ps_pgrp->pg_jobc == 0 check happens. OK mpi@ ket
Protect the ps_pgrp pointer by either the KERNEL_LOCK or the ps_mtx.
This should be enough to be on the safe side when unlocking ptsignal where a pr->ps_pgrp->pg_jobc == 0 check happens. OK mpi@ kettenis@
show more ...
|
#
c3476037 |
| 15-Oct-2024 |
claudio <claudio@openbsd.org> |
Indicate that a process has stopped by setting PS_STOPPED flag
The checks in dowait6 and orphanpg using ps_mainproc are flawed and fail if the mainproc called pthread_exit before the other threads.
Indicate that a process has stopped by setting PS_STOPPED flag
The checks in dowait6 and orphanpg using ps_mainproc are flawed and fail if the mainproc called pthread_exit before the other threads. Adding the flag in proc_stop_sweep is racy but the best we have right now. This fixes regress/sys/kern/signal/sig-stop3.
OK mpi@
show more ...
|
#
241d6723 |
| 08-Jul-2024 |
claudio <claudio@openbsd.org> |
Rework per proc and per process time usage accounting
For procs (threads) the accounting happens now lockless by curproc using a generation counter. Callers need to use tu_enter() and tu_leave() for
Rework per proc and per process time usage accounting
For procs (threads) the accounting happens now lockless by curproc using a generation counter. Callers need to use tu_enter() and tu_leave() for this. To read the proc p_tu struct tuagg_get_proc() should be used. It ensures that the values read is consistent.
For processes only the time of exited threads is accumulated in ps_tu and to get the proper process time usage tuagg_get_process() needs to be called. tuagg_get_process() will sum up all procs p_tu plus the ps_tu.
This removes another SCHED_LOCK() dependency. Adjust the code in exit1() and exit2() to correctly account for the full run time. For this adjust sched_exit() to do the runtime accounting like it is done in mi_switch().
OK jca@ dlg@
show more ...
|
#
223cf45d |
| 20-May-2024 |
claudio <claudio@openbsd.org> |
Rework interaction between sleep API and exit1() and start unlocking ps_threads
This diff adjusts how single_thread_set() accounts the threads by using ps_threadcnt as initial value and counting all
Rework interaction between sleep API and exit1() and start unlocking ps_threads
This diff adjusts how single_thread_set() accounts the threads by using ps_threadcnt as initial value and counting all threads out that are already parked. In single_thread_check call exit1() before decreasing ps_singlecount this is now done in exit1().
exit1() and thread_fork() ensure that ps_threadcnt is updated with the pr->ps_mtx held and in exit1() also account for exiting threads since exit1() can sleep.
OK mpi@
show more ...
|
#
470ec98d |
| 19-Jan-2024 |
bluhm <bluhm@openbsd.org> |
Backout priterator() for walking allprocess list.
This approach does not work as LIST_NEXT() of a removed element does not return NULL. I causes a crash in syzcaller and triggers kernel diagnostic
Backout priterator() for walking allprocess list.
This approach does not work as LIST_NEXT() of a removed element does not return NULL. I causes a crash in syzcaller and triggers kernel diagnostic assertion "vp->v_uvcount == 0" in sys/kern/kern_unveil.c line 845 during reboot. Unfortunately the backout brings back the race in fill_file() and fstat(1) may crash the kernel.
Reported-by: syzbot+54fba1c004d7383d5e85@syzkaller.appspotmail.com
show more ...
|
#
d221342b |
| 15-Jan-2024 |
mvs <mvs@openbsd.org> |
Introduce priterator(), the `ps_list' iterator. Some of `allprocess' list walkthroughs have context switch within, so make exit1() wait until the last reference released.
Reported-by: syzbot+0e9dda7
Introduce priterator(), the `ps_list' iterator. Some of `allprocess' list walkthroughs have context switch within, so make exit1() wait until the last reference released.
Reported-by: syzbot+0e9dda76c42c82c626d7@syzkaller.appspotmail.com
ok bluhm claudio
show more ...
|
#
f191aecb |
| 19-Sep-2023 |
claudio <claudio@openbsd.org> |
Improve the output of ddb "show proc" command
Include missing fields -- like the sleep channel and message -- and show both the PID and TID of the proc. Also add '/t' as an argument that can be used
Improve the output of ddb "show proc" command
Include missing fields -- like the sleep channel and message -- and show both the PID and TID of the proc. Also add '/t' as an argument that can be used to specify a proc by TID instead of by address. OK mpi@
show more ...
|
#
c835f76b |
| 02-Jan-2023 |
guenther <guenther@openbsd.org> |
Add tfind_user(), for getting a proc* given a user-space TID and the process* that it should be part of. Use that in clock_get{time,res}(), thrkill(), and ptrace().
ok jca@ miod@ mpi@ mvs@
|
#
14f56bac |
| 07-Dec-2022 |
mvs <mvs@openbsd.org> |
Document 'uidinfo' structure locks.
Inputs and ok bluhm@
|
#
0d280c5f |
| 14-Aug-2022 |
jsg <jsg@openbsd.org> |
remove unneeded includes in sys/kern ok mpi@ miod@
|
#
da571ddd |
| 24-Oct-2021 |
jsg <jsg@openbsd.org> |
use NULL not 0 for pointer values in kern ok semarie@
|
#
193f316c |
| 08-Feb-2021 |
mpi <mpi@openbsd.org> |
Revert the convertion of per-process thread into a SMR_TAILQ.
We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change.
|
#
b21c774f |
| 07-Dec-2020 |
mpi <mpi@openbsd.org> |
Convert the per-process thread list into a SMR_TAILQ.
Currently all iterations are done under KERNEL_LOCK() and therefor use the *_LOCKED() variant.
From and ok claudio@
|
#
2659a4f5 |
| 26-Sep-2020 |
kettenis <kettenis@openbsd.org> |
Remove the PR_WAITOK flag from the ucred_pool. The pool items are small enough that this pool uses the single page allocator for which PR_WAITOK is a no-op. However it presence suggests that pool_p
Remove the PR_WAITOK flag from the ucred_pool. The pool items are small enough that this pool uses the single page allocator for which PR_WAITOK is a no-op. However it presence suggests that pool_put(9) may sleep. The single page allocator will never actually do that.
This makes it obvious that refreshcreds() will not sleep.
ok deraadt@, visa@
show more ...
|
#
fffcd96b |
| 16-Sep-2020 |
mpi <mpi@openbsd.org> |
Move duplicated code to send an uncatchable SIGABRT into a function.
ok claudio@
|
#
24e0bd45 |
| 30-Jan-2020 |
mpi <mpi@openbsd.org> |
Split `p_priority' into `p_runpri' and `p_slppri'.
Using different fields to remember in which runqueue or sleepqueue threads currently are will make it easier to split the SCHED_LOCK().
With this
Split `p_priority' into `p_runpri' and `p_slppri'.
Using different fields to remember in which runqueue or sleepqueue threads currently are will make it easier to split the SCHED_LOCK().
With this change, the (potentially boosted) sleeping priority is no longer overwriting the thread priority. This let us get rids of the logic required to synchronize `p_priority' with `p_usrpri'.
Tested by many, ok visa@
show more ...
|
#
e0e8a7c4 |
| 12-Nov-2018 |
visa <visa@openbsd.org> |
Add a mechanism for managing asynchronous IO signal registrations. It centralizes IO signal privilege checking and makes possible to revoke a registration when the target process or process group is
Add a mechanism for managing asynchronous IO signal registrations. It centralizes IO signal privilege checking and makes possible to revoke a registration when the target process or process group is deleted.
Adapted from FreeBSD.
OK kettenis@ mpi@ guenther@
show more ...
|
#
0ff991d2 |
| 21-Jun-2018 |
visa <visa@openbsd.org> |
Use atomic operations for updating cred structure reference counts to make crfree() and crhold() MP-safe. Make crhold() a proper function. Put the definition into file kern_prot.c to constrain the ne
Use atomic operations for updating cred structure reference counts to make crfree() and crhold() MP-safe. Make crhold() a proper function. Put the definition into file kern_prot.c to constrain the need of the <sys/atomic.h> header.
While there, adjust the IPL of ucred_pool to avoid lock order problems with the kernel lock (pointed out by kettenis@).
OK mpi@
show more ...
|
#
29256776 |
| 27-Mar-2018 |
mpi <mpi@openbsd.org> |
Make sure that programs violating a pledge(2) promise or some memory protection cannot block the final SIGABRT.
While here apply the same logic to ddb(4)'s kill command.
From semarie@, ok deraadt@
|
#
b054dc0d |
| 26-Feb-2018 |
mpi <mpi@openbsd.org> |
Serialize access to UID data with a rwlock.
Caller must call uid_release() after making whatever change they needed on the result of uid_find().
Adapted from guenther@'s proctree diff, ok dlg@, vis
Serialize access to UID data with a rwlock.
Caller must call uid_release() after making whatever change they needed on the result of uid_find().
Adapted from guenther@'s proctree diff, ok dlg@, visa@
show more ...
|
#
45c2dfd4 |
| 20-Feb-2018 |
mpi <mpi@openbsd.org> |
Introduce enternewpgrp() & enterthispgrp(), from FreeBSD via guenther@.
This code shuffling will ease the introduction of the proctree lock in sys_setsid() and sys_setpgid().
Extracted from a large
Introduce enternewpgrp() & enterthispgrp(), from FreeBSD via guenther@.
This code shuffling will ease the introduction of the proctree lock in sys_setsid() and sys_setpgid().
Extracted from a larger diff from guenther@, ok visa@
show more ...
|
#
c33efb07 |
| 10-Feb-2018 |
mpi <mpi@openbsd.org> |
Move cleanup job control bits to their own function.
Part of the larger 'proctreelk' diff from guenther@
No functional change, ok benno@, tedu@
|
#
98edb555 |
| 30-Dec-2017 |
guenther <guenther@openbsd.org> |
Delete unnecessary <sys/file.h> includes
ok millert@ krw@
|
#
ba0fc568 |
| 04-Dec-2017 |
mpi <mpi@openbsd.org> |
Change __mp_lock_held() to work with an arbitrary CPU info structure and extend ddb(4) "ps /o" output to print which CPU is currently holding the KERNEL_LOCK().
Tested by dhill@, ok visa@
|
#
a00d4ff8 |
| 29-Sep-2017 |
mpi <mpi@openbsd.org> |
New ddb(4) command: kill.
Send an uncatchable SIGABRT to the process specified by the pid argument. Useful in case of CPU exhaustion to kill the DoSing process and generate a core for later inspect
New ddb(4) command: kill.
Send an uncatchable SIGABRT to the process specified by the pid argument. Useful in case of CPU exhaustion to kill the DoSing process and generate a core for later inspection.
ok phessler@, visa@, kettenis@, miod@
show more ...
|