| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.
|
|
|
|
|
|
|
| |
Currently all iterations are done under KERNEL_LOCK() and therefor use
the *_LOCKED() variant.
From and ok claudio@
|
|
|
|
|
|
|
| |
The underlying vm_space lock is used as a substitute to the KERNEL_LOCK()
in uvm_grow() to make sure `vm_ssize' is not corrupted.
ok anton@, kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reparented to a debugger process.
Also re-parent exiting traced processes to their original parent, if it
is still alive, after the debugger has seen the exit status.
Logic comes from FreeBSD pointed out by guenther@.
While here rename proc_reparent() into process_reparent() and get rid of
superfluous checks.
ok visa@
|
|
|
|
|
|
|
|
|
| |
Convert those to a consolidated status when needed in wait4(), kevent(),
and sysctl()
Pass exit code and signal separately to exit1()
(This also serves as prep for adding waitid(2))
ok mpi@
|
|
|
|
|
|
| |
Match FreeBSD and NetBSD.
ok bluhm@, deraadt@, kettenis@
|
|
|
|
|
|
| |
simpler. No functional change.
Extracted from a larger diff from guenther@, ok kettenis@
|
|
|
|
|
|
|
| |
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- control operations: trace_me, attach, detach, step, kill, continue.
Manipulate process relation/state or send a signal
- kernel-state get/set: thread list, event mask, trace state.
About the process and don't require target to be stopped, need copyin/out
- user-state get/set: memory, register, window cookie.
Often thread-specific, require target to be stopped, need copyin/out
sys_ptrace() changes to handle request checking, copyin/out to
kernel buffers with size check and zeroing, and dispatching to the
routines above for the real work. This simplfies the permission checks
and copyin/out handling and will simplify lock handling in the future.
Inspired in part by FreeBSD.
ok mpi@ visa@
|
|
|
|
|
| |
Found by Ilja Van Sprundel
ok kettenis
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
| |
While here document prfind(9.
with and ok guenther@
|
|
|
|
|
|
| |
initial thread
ok jsing@ kettenis@
|
|
|
|
|
|
|
| |
Make process_auxv_offset() take and release a reference of the vmspace like
process_domem() does.
ok kettenis@
|
|
|
|
|
|
| |
powerpc: rename second argument of pmap_proc_iflush() to match other archs
ok kettenis@
|
|
|
|
|
|
| |
are for option PTRACE only
ok kettenis@
|
|
|
|
| |
OK natano@ guenther@
|
|
|
|
|
|
|
| |
Broken in r.1.33. After discussion from kettenis@, don't attempt to
make PT_WRITE_D and PT_WRITE_I equivalent again.
From Mathieu (naabed at poolp dot org)
|
|
|
|
| |
also fix the confusing comment. ok guethner.
|
|
|
|
|
|
|
|
| |
per-process value, and therefpore turns the VM_PSSTRINGS sysctl into a
per-process one as well. This gets rid of a pointer to the bottom of the
stack at a fixed location. Also clears the road for unmapping the stackgap.
ok deraadt@
|
|
|
|
|
|
| |
controls whether you can ptrace any process with appropriate privileges
or only one own's children.
ok deraadt
|
|
|
|
|
|
| |
months that I broke it before the 5.5 release.
confirmed as not being required by ports by sthen@, ajacoutot@, dcoppa@
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
| |
Remember initprocess instead of initproc.
ok matthew@ blambert@
|
|
|
|
|
|
|
| |
and FORK_SYSTEM as a flag to set them. This eliminates needing to
peek into other processes threads in various places. Inspired by NetBSD
ok miod@ matthew@
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
| |
stop, just like we do for PT_CONTINUE/PT_STEP. The current code isn't
ready for directing signals to other threads yet.
|
|
|
|
|
|
|
|
|
|
| |
It implements a full-stop model where all threads are stopped before handing
over control to the debugger. Events are reported as before through wait(2);
you will have to call ptrace(PT_GET_PROCESS_STATE, ...) to find out which
thread hit the event. Since this changes the size of struct ptrace_state,
you will have to recompile gdb.
ok guenther@
|
|
|
|
|
|
|
|
|
|
| |
threads list. Calling TAILQ_NEXT on them is a bad idea and will panic
the kernel. So check the P_WEXIT flag and pretend the thread doesn't
exist if it is set. Also make PT_GET_THREAD_FIRST return the first
thread on the threads list instead of the "main" thread, such that you
can actually keep enumerating the threads in this case.
ok guenther@, miod@
|
| |
|
|
|
|
| |
ok guenther@
|
|
|
|
| |
ok miod@
|
|
|
|
| |
the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
|
|
|
|
| |
in previous rev.
|
|
|
|
|
|
|
|
|
|
| |
- move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and
p_ptstat member from struct proc to struct process
- sort the PT_* requests into those that take a PID vs those that
can also take a TID
- stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT
ok kettenis@
|
|
|
|
|
|
| |
that you can't evade the checks by doing the dirty work in an rthread
ok blambert@, deraadt@
|
|
|
|
|
|
|
|
|
| |
so that the process-level stuff is to/from struct process and not
struct proc. This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.
Tested by many: deraadt, sthen, krw, ray, and in snapshots
|
|
|
|
|
|
|
|
| |
it defines. In some cases, this means pulling in uvm.h or pcb.h
instead, but most of the inclusions were just noise. Tested on
alpha, amd64, armish, hppa, i386, macpcc, sgi, sparc64, and vax,
mostly by krw and naddy.
ok krw@
|
|
|
|
|
|
|
| |
gcc4 from complaining about casting a pointer to an integer type of different
size.
ok guenther@, jsg@
|
|
|
|
|
|
|
|
| |
of a direct ancestor, closing a localhost DoS. As an exception,
do permit ptrace() of pid 1 and have inferiors() stop climbing if
it hits that.
ok tedu@ hpux_compat suggestion from miod@
|
|
|
|
|
|
|
| |
sleeping calls. Since we are simply operating on another process'
vmspace, grab a (refcounted) copy of that pointer and use that instead.
Similar to the bug just fixed in sysctl_proc_args.
discussed with art
|
| |
|
| |
|
|
|
|
| |
ok miod@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
it's a good idea to use atomic.h operations on it. This mechanic
change updates all bit operations on p_flag to atomic_{set,clear}bits_int.
Only exception is that P_OWEUPC is set by MI code before calling
need_proftick and it's automatically cleared by ADDUPC. There's
no reason for MD handling of that flag since everyone handles it the
same way.
kettenis@ ok
|
|
|
|
|
|
|
|
|
|
| |
should never be referenced outside the context of the process to which
this stack belongs unless we do the PHOLD/PRELE dance. Loads of code
doesn't follow the rules here. Instead of trying to track down all
offenders and fix this hairy situation, it makes much more sense
to not swap kernel stacks.
From art@, tested by many some time ago.
|