Age | Commit message (Collapse) | Author |
|
if a sleep is interrupted but the thread is also stopped that on a wakeup
the thread runs again.
OK mpi@
|
|
|
|
duplicated code with no benefit.
ok mpi@ miod@ deraadt@
|
|
A SIGSTOP delivered between sleep_setup() and sleep_finish() will
just change the proc state to SSTOP and sleep_finis() needs to respect
that and make sure the thread stays stopped until a SIGCONT is issued.
OK mpi@
|
|
OK dlg@
|
|
accessed integer.
ok bluhm
|
|
ok mpi@ miod@
|
|
Also use atomic_load_int(9) to load `securelevel'. sysctl_securelevel()
is mp-safe, but will be under kernel lock until all existing
`securelevel' loading became mp-safe too.
ok mpi
|
|
Allocating VAs is done via uvm_map(9) which is safe to call without
KERNEL_LOCK() since mmap(2) & friends have been marked NOLOCK.
ok mvs@
|
|
protected by `timeout_mtx' mutex(9).
ok kettenis
|
|
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@
|
|
defined(DEBUG) || defined(DIAGNOSTIC) || defined(VFSLCKDEBUG)
as they won't be used otherwise.
Shaves a few bytes off installation kernels.
ok kn@ semarie@
|
|
ok claudio@
|
|
Add deep flag as function argument which is used by the sleep API but
nowhere else. Both calls to sleep_signal_check() should skip the ugly
bits of cursig().
In cursig() if deep once it is clear a signal will be taken keep the
signal on the thread siglist and return. sleep_signal_check() will then
return EINTR or ERESTART based on the signal context. There is no reason
to do more in this special case. Especially stop/cont and the ptrace trap
must be skipped here. Once the call makes it to userret the signal will be
picked up again and handled in a safe location.
Stopping singals need some additional logic since we don't want to abort
the sleep just to stop a process. Since our SIGSTOP handling requires
a major rewrite this will be posponed until then.
OK mpi@
|
|
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@
|
|
is modified.
OK tb@ jca@
|
|
|
|
Also remove the ps_xsig handling in setrunnable() it is in the wrong spot
and causes signals to be delivered over and over again.
Attaching to an already stopped process is affected by this. The SIGSTOP
sent by ptrace is now ignored in ptsignal() and as a result gdb will hang
in wait4() until a SIGCONT is delivered to the process. After that all
works as usual.
OK mpi@
|
|
Also do not use ps_mainproc as the thread the signal is send to. Sending
a signal to ps_mainproc may not work reliably if it already exited. Use
TAILQ_FIRST(&pr->ps_threads) instead but first check that the process has
not yet entered exit1().
OK mpi@
|
|
process struct).
This simplifies some code and removes the no need to call prfind in
process_untrace().
OK mpi@
|
|
OK mpi@ kn@
|
|
ps_pptr, ps_ppid and ps_oppid require the KERNEL_LOCK and the process mutex
to be modified. At the same time either KERNEL_LOCK or process mutex needs
to be taken to read the values.
This is needed to further unlock ptsignal().
OK kettenis@, mvs@
|
|
to always be put inside functions.
This allows such statements to appear anywhere in assym.cf; without this
change they would require at least one `export' or `define' stanza to occur
first.
Problem noticed by & ok jsg@
|
|
|
|
|
|
runtime of the process. Also this no longer needs the SCHED_LOCK().
OK mpi@
|
|
use the proper way to read tu_runtime.
OK mpi@
|
|
the destination by adding const to the source pointer.
OK tb@
|
|
Introduce P_TRACESINGLE flag to instruct the trapped thread to not
wakeup the other threads (via single_thread_clear). This must be done
like this since ptrace must wake just the single thread to ensure it
runs first and gets the ps_xsig value from ptrace.
Modern gdb depends on this for multi-threaded processes, when a breakpoint
is hit gdb fixes up the trapping instruction and then single steps over
it with only that thread. After that single step gdb continues with all
threads. If all threads are run like now it is possible that one of the
other threads hits a breakpoint before the single step is done which results
in an assertion in gdb (because that is not expected).
OK mpi@
|
|
OK mpi@
|
|
OK mpi@
|
|
It can happen that an interrupt handler is called immediately on a
secondary CPU when it is spun up during boot. At that moment no
process is schduled yet, so curproc is NULL. To prevent a crash
when p->p_sleeplocks is dereferenced, skip witness check in this
case.
OK visa@
|
|
When mallocarray(9) sleeps, disk_count can change, and diskstatslen
gets inconsistent. This caused free(9) to panic.
Reported-by: syzbot+36e1f3b306f721f90c72@syzkaller.appspotmail.com
OK deraadt@ mpi@
|
|
ok sthen
|
|
Using 8k for socketpairs was always on the low end side. Also this
avoid a fatal error in sshd that can be triggered when the network
stack is pushed hard enough to consume most of the allowed memory.
By increasing the default buffer size a bit the error in sshd is
avoided which is good enough for now.
Long term a better solution for sonewconn() and especially sbchecklowmem()
needs to be found. m_pool_used() returns not the right information for
them.
OK deraadt@ otto@
|
|
Fix from yufeng.gao@uq.edu.au
|
|
Use %zu to print mbuf MHLEN and MLEN in ddb, otherwise gcc complains.
found by claudio@
|
|
Command "ddb> show /c mbuf" always prints mbuf data size. In
uipc_mbuf.c include db_interface.h as it contains prototype for
m_print_chain().
OK mvs@
|
|
ok anton@
|
|
From Christian Ludwig.
ok claudio@
|
|
For debugging hardware offloading, DMA requirements, bounce buffers,
and performance optimizations, knowing the memory layout of mbuf
content helps.
Implement /c and /p modifiers in ddb show mbuf. It traverses the
pointer m_next for mbuf chain or m_nextpkt for packet list. Show
mbuf type, data offset, mbuf length, packet length, cluster size,
and total number of elements, length and size.
OK claudio@ mvs@
|
|
'fine with me' hshoexer, ok bluhm@
|
|
|
|
not map nicely to UNVEIL_EXEC. But we don't know before calling
namei() if the path is a directory. Oh well, stick to UNVEIL_READ
for that case, it is going to be good enough for the typical case.
Worked out with jeremy after chrome/firefox Downloads directory issue.
|
|
Limit ccp ioctls to processes that pledge vmm. Specific psp device
ioctls for AMD SEV will allowed for vmd(8).
from hshoexer@; input deraadt@ jsg@
|
|
for valid requests. This is because the nd.ni_unveil to namei() was
always UNVEIL_READ, regardless of the request amode. Building a
correct ni_unveil passes a new regression test, producing expected
results.
ok beck jeremy
|
|
The memmove() in m_pulldown() copied memory between different mbufs.
So data cannot overlap and memcpy() is enough.
OK claudio@ deraadt@
|
|
If the memory layout is not optimal, m_defrag(), m_prepend(),
m_pullup(), and m_pulldown() will allocate mbufs or copy memory.
Count these operations to find possible optimizations.
input dhill@; OK mvs@
|
|
|
|
|