summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* For now, direct the kill signal sent by PT_KILL to the thread that made uskettenis2012-04-131-1/+4
| | | | | stop, just like we do for PT_CONTINUE/PT_STEP. The current code isn't ready for directing signals to other threads yet.
* First stab at making ptrace(2) usable for debugging multi-threaded programs.kettenis2012-04-131-9/+13
| | | | | | | | | | 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@
* If the "main" thread exits it stays around but unlinks itself from thekettenis2012-04-121-2/+4
| | | | | | | | | | 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@
* PT_GETXMMREGS and PT_SETXMMREGS can take a TID.kettenis2012-04-121-1/+7
|
* Move the P_WAITED flag from struct proc to struct process.kettenis2012-04-111-5/+3
| | | | ok guenther@
* Implement PT_GET_THREAD_FIRS and PT_GET_THREAD_NEXT.kettenis2012-04-061-5/+23
| | | | ok miod@
* Add PS_EXITING to better differentiate between the process exiting andguenther2012-03-101-2/+2
| | | | the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
* Allow this to build on platforms lacking PT_GETFPREGS or PT_SETFPREGS; brokenmiod2012-02-251-1/+5
| | | | in previous rev.
* First steps for making ptrace work with rthreads:guenther2012-02-201-53/+129
| | | | | | | | | | - 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@
* Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soguenther2011-04-021-6/+4
| | | | | | that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-11/+11
| | | | | | | | | 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
* Don't #include <sys/user.h> into files that don't need the stuffguenther2010-06-261-2/+1
| | | | | | | | 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@
* Use intermediate vaddr_t cast when casting a pointer to off_t. Preventskettenis2010-05-021-9/+9
| | | | | | | gcc4 from complaining about casting a pointer to an integer type of different size. ok guenther@, jsg@
* Make sure the process tree is is loop-free by forbidding ptrace()guenther2010-01-281-1/+9
| | | | | | | | 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@
* Do not assume that a pointer to another process will live over a set ofderaadt2008-10-311-4/+9
| | | | | | | 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
* accidental commit ... backoutderaadt2008-10-311-9/+4
|
* kern_sysctl.cderaadt2008-10-311-4/+9
|
* Add PIOD_READ_AUXV, a way to get the ELF auxilliary vector through ptrace(2).kettenis2008-09-161-1/+57
| | | | ok miod@
* ``it's'' -> ``its'' when the grammar gods require this change.miod2007-04-101-2/+2
|
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-4/+4
| | | | | | | | | | | | 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
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-18/+1
| | | | | | | | | | 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.
* make kernels w/o PTRACE compile again.grunk2006-07-191-1/+3
| | | | help from mickey@, "commit it" miod@
* paramter -> parametermiod2006-05-181-2/+2
|
* ansi/deregister. No binary change.jsg2005-12-131-5/+2
|
* Replace procfs_domem() with a similar interface, process_domem(), which livesmiod2005-12-111-13/+87
| | | | | | | out of procfs and gets a ptrace request PT_{READ,WRITE}_{I,D} as argument; also procfs_checkioperm() becomes process_checkioperm(). From art@ some time ago; ok kettenis@ pedro@
* ptrace(2) following fork(2)kettenis2005-09-141-1/+34
| | | | ok miod@
* Reduce stack usage.kettenis2005-08-021-34/+50
|
* Remove regs and fpregs pseudo-files from procfs.kettenis2005-04-161-41/+49
| | | | ok deraadt@, miod@
* Implemente PT_[GS]ETXMMREGS ptrace(2) requests on i386.kettenis2005-04-031-1/+41
| | | | ok deraadt@
* debranch SMP, have funniklas2004-06-131-1/+5
|
* restored & repaired wcookie support; kettenis@chello.nlderaadt2004-02-081-1/+13
|
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-2/+2
| | | | | | | | | argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Disallow ptrace if P_SUGIDEXEC flag is set (we already disallow if P_SUGIDmillert2003-03-091-6/+7
| | | | is set). deraadt@ and tholo@ OK.
* KNFderaadt2002-06-271-2/+2
|
* don't attach to system processes.fgsch2002-04-101-4/+10
| | | | art@ niklas@ markus@ millert@ deraadt@ ok.
* Change the PT_IO interfaces like discussed onart2002-03-121-7/+8
| | | | the bsd-api-discuss list.
* In the PT_STEP case, first set the new pc, then arrangeart2002-03-121-6/+6
| | | | | | for the single-step. This can slightly break the error handling when setting the sstep fails, but allows us to emulate single stepping in software on arch that don't have support for that in hardware.
* Since all archs implement PT_GETREGS and PT_SETREGS, make then unoptional.art2002-03-111-12/+1
| | | | | | | | They still stay in MD code for backwards compatibility, but a check in ptrace.h checks if they are defined. Note - the same thing will be done with PT_{GET,SET}FPREGS once vax implements them and with PT_STEP when it's implemented by sparc, sparc64 and alpha.
* Add a more sane API for reading/writing traced process memoryart2002-03-111-2/+30
| | | | | with ptrace - PT_IO. Man page update in a few.
* Move SET/CLR/ISSET macros to param.h. fgsch@ and millert@ oknordin2002-01-301-6/+1
|
* When a process is exec:ing mark it with a flag. Check that flag in ptraceart2002-01-201-1/+4
| | | | | | and procfs (and possibly more places in the future) and simply refuse to fiddle with the execing process. This is an ugly hack, but this far we haven't been successful in creating a race-free exec.
* register_t is not an int, so don't use it that way.art2002-01-021-4/+8
| | | | Fixes PT_{READ,WRITE}_{I,D} on sparc64.
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-2/+1
| | | | (Look ma, I might have broken the tree)
* remove old vmart2001-06-271-3/+1
|
* trace_req is not used anymore (was a nop).art2001-06-181-10/+1
|
* split PT_DETACH handling, so that pc cannot be set by it; art okderaadt2001-06-181-14/+38
|
* Add emulation of Linux features to procfs; mostly from NetBSD. ok deraadt@tholo2001-04-091-3/+3
|
* seperate -> separate, okay aaron@provos2000-11-101-3/+3
|
* Add explicit inclusions of signalvar.h to files actually using syms definedniklas2000-06-081-1/+2
| | | | there but relying on an indirect inclusion