summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Apply profiling to all threads instead of just the thread that calledguenther2012-08-021-2/+2
| | | | | | | profil() by moving P_PROFIL from proc->p_flag to process->ps_flags with matching adjustment in fork1() and exit1() ok matthew@
* Correct the error path in execve when there's a race to single threadguenther2012-05-011-2/+2
| | | | | | the process. noted and ok markus@
* Add struct proc * argument to FRELE() and FILE_SET_MATURE() inguenther2012-04-221-2/+2
| | | | | | anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
* First stab at making ptrace(2) usable for debugging multi-threaded programs.kettenis2012-04-131-3/+3
| | | | | | | | | | 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@
* move accounting flags to struct process; idea and ok guenthermikeb2012-04-121-2/+2
|
* clear junk in p_comm before copying shorter names into itderaadt2012-03-261-2/+2
| | | | ok jsing guenther miod
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-8/+5
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* New vmmap implementation.ariane2012-03-091-4/+2
| | | | | | | | | | | | no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
* First steps for making ptrace work with rthreads:guenther2012-02-201-6/+6
| | | | | | | | | | - 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@
* Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,guenther2012-02-151-4/+11
| | | | | | | | or fd_{lo,hi}maps members, or when doing a read for a write. Fixes hangs when an rthreaded processes sleeps while copying the fd table for fork() and catches another thread with the lock. ok jsing@ tedu@
* Handle rthreads consistently in ktrace by moving the flags and vnode intoguenther2011-12-141-5/+3
| | | | | | | | struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials used to open the file in sys_ktrace() and use them for all writes to the vnode. much feedback and ok jsing@
* Suspend other rthreads before dumping core or execing; make them exitguenther2011-12-111-1/+14
| | | | | | when exec succeeds. ok jsing@
* TCB address should be reset when execing, to provide a clean setup forguenther2011-10-161-1/+6
| | | | the new image
* Backout vmmap in order to repair virtual address selection algorithmsariane2011-06-061-1/+2
| | | | outside the tree.
* Reimplement uvm/uvm_map.ariane2011-05-241-2/+1
| | | | | | | | | | | | | vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
* Move P_EXEC flag from struct proc to process, so that setpgid() willguenther2011-04-041-2/+2
| | | | | | fail regardless of which rthread calls execve() ok blambert@
* Move PPWAIT flag from struct proc to process, so that rthreads inguenther2011-04-031-3/+4
| | | | | | | | | a vforked child behave correctly. Have the parent in a vfork() wait on a (different) flag in *its* process instead of the child to prevent a possible use-after-free. When ktracing the child return from a fork, call it rfork if an rthread was created. ok blambert@
* Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, soguenther2011-04-021-15/+14
| | | | | | that you can't evade the checks by doing the dirty work in an rthread ok blambert@, deraadt@
* Allow MD code to setup MD-specific mappings (kinda similar to the signalmiod2010-11-241-1/+7
| | | | | trampoline) in sys_execve(), if MD <machine/_types.h> defines __HAVE_EXEC_MD_MAP.
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-4/+4
| | | | | | | | | 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
* move knote list to struct process. ok guenthertedu2010-05-181-2/+2
|
* fix typos in comments, no code changes;schwarze2010-01-141-2/+2
| | | | | from Brad Tilley <brad at 16systems dot com>; ok oga@
* Remove the VREF() macro and replaces all instances with a call to verf(),thib2009-07-091-2/+2
| | | | | | | | | | | which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
* properly terminate fake argument list.thib2009-01-041-2/+2
| | | | | | From NetBSD; OK deraadt@
* accidental commit ... backoutderaadt2008-10-311-5/+2
|
* kern_sysctl.cderaadt2008-10-311-2/+5
|
* Make sure we reserve enough stack space on MACHINE_STACK_GROWS_UP architectureskettenis2008-02-131-3/+6
| | | | | | by aligning the stack gap. Fixes gettext port build (and probably many others). ok miod@, tedu@, tested by sthen@
* Don't store arguments and environment in the space reserved for stackgap onkettenis2007-12-111-3/+3
| | | | | | machines where the stack grows up. Fixes systrace(1) on hppa. ok deraadt@
* MALLOC/FREE -> malloc/freechl2007-10-291-4/+4
| | | | | | replace an hard coded value with M_WAITOK ok krw@
* replace ctob and btoc with ptoa and atop respectivelymartin2007-09-151-4/+4
| | | | help and ok miod@ thib@
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-12/+11
| | | | | | | | | | | | 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
* Remove two ancient debugging printfs.art2007-03-011-3/+1
|
* typos; from bret lambertjmc2006-11-151-2/+2
|
* redo (w/ proper changes everywhere ;):mickey2006-01-191-3/+3
| | | | | | take interp[MAXPATHLEN] off the stack. from mickey, ok otto while here, switch above from malloc to pool, remove stupid casts tedu@ miod@ ok
* do not allow setugid processes to use /dev/fd/#, unless they are aderaadt2005-12-071-1/+5
| | | | | setuid-script and are attempting to dup is the specific setuid-script fd via such a pathname; ok tedu pedro millert
* kernel support for threaded processes (rthreads).tedu2005-12-031-2/+2
| | | | | | | | uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
* ansi/deregister.jsg2005-11-281-13/+5
| | | | 'go for it' deraadt@
* catched->caughtmiod2005-08-141-2/+2
|
* - We shouldn't allocate MAXPATHLEN from the stack.art2005-08-011-17/+29
| | | | | - Don't copy the pathbuf into kernel space unless we're systracing. deraadt@ ok
* clear vm_dused at exec time, since we are potentially re-using the vmspace;deraadt2005-07-071-1/+2
| | | | | fixes resource accounting in a mmap malloc world ok "too busy but looks right" tedu, tdeval
* pull in new MD STACKGAP_RANDOMderaadt2005-04-111-2/+2
|
* Fail exec for disabled compat with EPERM rather than ENOEXEC.miod2005-03-091-2/+2
| | | | ok deraadt@ mickey@ millert@
* back out the last change as it seems to produce problems found by brad@; deraadt@ okmickey2004-08-241-3/+3
|
* leave space for stackgap on growsuppersmickey2004-08-011-3/+3
|
* fix an issue when scripts are exec'd under systrace wheremarius2004-07-071-2/+5
| | | | | | | | | the argv[0] would be normalized, and hence break scripts that depend on how they were called. this fixes an issue in the ports builds. ok provos@ deraadt@; lots of testing during hackathon sturm@ naddy@
* a few fixes to systracemarius2004-06-231-2/+38
| | | | | | | | | | | | - add an exec message so that whenever a set-uid/gid process exec's a new image which we may control, the exec does not go by unnoticed. - take special care to check for P_SUGIDEXEC as well as P_SUGID, corresponding to the same changes that were made in the ptrace code a while ago ok niels@, sturm@; thanks to naddy for testing
* vm->vm_minsaddr was uninitialized (nothing realy uses it anyway)mickey2004-06-111-1/+2
|
* use pool for namei pathbuf. testing ok millert@ tdeval@tedu2004-05-141-6/+7
|
* don't leak memory on error, from Patrick Latifitedu2004-03-121-3/+10
| | | | ok deraadt@ millert@
* Decrement reference count in error case if uvm_map(9) fails and wemillert2004-02-051-1/+3
| | | | | had previously increased the reference count. Should not happen, but... From dhartmei@; ok deraadt@