summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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@
* match syscallargs comments with realityhenning2003-09-011-4/+4
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* emulation is now controlled by sysctl. changes:tedu2003-08-211-14/+4
| | | | | | | | | add e_flags to struct emul. this stores on/off and native flags. check for emul enabled in check_exec(). gather all the emuls into a emulsw so a sysctl can find them. create sysctl. move maxhdrsiz calcualation into init_main so it cleans up sys_execve codepath. teach sysctl utility to grok kern.emul hierarchy. requested and ok deraadt@ some comments from mickey@
* add exec/fork/exit hooks per process for compat emulations.tedu2003-06-211-2/+25
| | | | | | | | | | use them to correctly emulate linux brk. update to TNF copyright in linux_exec.c. from netbsd, mostly from a diff by Kurt Miller in pr3318. this should fix java. no regressions in testing by kurt and sturm@. be prepared for "proc size mismatch" -- recompile ps and friends. ok deraadt@
* stackgap_random becomes 64Kderaadt2003-06-021-2/+2
|
* Typos; from Julien Bordet <zejames@greyhats.org>grange2003-05-171-2/+2
| | | | Close PR 3262
* There are two related changes.art2003-04-141-2/+2
| | | | | | | | | | | | The first one is an mquery(2) syscall. It's for asking the VM system about where to map things. It will be used by ld.so, read the man page for details. The second change is related and is a centralization of uvm_map hint that all callers of uvm_map calculated. This will allow us to adjust this hint on architectures that have segments for non-exec mappings. deraadt@ drahn@ ok.
* Make the semantics of the P_SUGIDEXEC flag match the issetugid(2)millert2003-03-091-5/+9
| | | | | | | man page. Instead of just clearing P_SUGIDEXEC if real and effective uids/gids matched, we now set P_SUGIDEXEC if there is a mismatch in the real, effective, or saved uid/gid and clear it otherwise. deraadt@ and tholo@ OK.
* descructive -> destructivemiod2002-12-111-2/+2
|
* No need to exit the process twice. exit1() can't fail.art2002-12-041-2/+1
|