summaryrefslogtreecommitdiffstats
path: root/sys/kern/exec_script.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Do not relock fdp in fdrelease(). This prevents unnecessary lockingvisa2019-07-151-2/+2
| | | | | | in the common case. OK mpi@
* Put file descriptors on shared data structures when they are completelympi2018-06-181-5/+8
| | | | | | | | | | | | | | | | | setup, take 3. LARVAL fd still exist, but they are no longer marked with a flag and no longer reachable via `fd_ofiles[]' or the global linked list. This allows us to simplifies a lot code grabbing new references to fds. All of this is now possible because dup2(2) refuses to clone LARVAL fds. Note that the `fdplock' could now be release in all open(2)-like syscalls, just like it is done in accept(2). With inputs from Mathieu Masson, visa@, guenther@ and art@ Previous version ok bluhm@, ok visa@, sthen@
* Revert introduction of fdinsert(), a sanitify check triggers whenmpi2018-06-051-8/+5
| | | | | | closing a LARVAL file. Found the hardway by sthen@.
* Put file descriptors on shared data structures when they are completelympi2018-06-021-5/+8
| | | | | | | | | | | | | | | | | setup. LARVAL fd still exist, but they are no longer marked with a flag and no longer reachable via `fd_ofiles[]'. This allows us to simplifies a lot code grabbing new references to fds. All of this is now possible because dup2(2) refuses to clone LARVAL fds. Note that the `fdplock' could now be release in all open(2)-like syscalls, just like it is done in accept(2). With inputs from Mathieu -, visa@, guenther@ and art@ ok visa@, bluhm@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-021-2/+2
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-2/+2
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Stop assuming <sys/file.h> will pull in fcntl.h when _KERNEL is defined.guenther2018-01-021-1/+2
| | | | ok millert@ sthen@
* We are either allocating 2 or three array members. Unroll while loopflorian2018-01-011-6/+8
| | | | | | | to be able to call free(9) with sizes. off-by-one pointed out by guenther OK visa
* Add a flags argument to falloc() that lets it optionally set theguenther2017-02-111-2/+2
| | | | | | | close-on-exec flag on the newly allocated fd. Make falloc()'s return arguments non-optional: assert that they're not NULL. ok mpi@ millert@
* boom goes the dynamitetedu2016-04-251-22/+3
|
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-2/+2
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* NULL-terminate a pointer array to prevent an invalid free, and simplifymmcc2015-12-311-8/+9
| | | | | | the associated pointer incrementing logic. Reported by Maxim Pugachev. Looks good to tedu@
* sizes for free(); ok sthenderaadt2015-09-101-2/+2
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+2
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* panic should be reserved for unrecoverable errors, not things we merelytedu2014-11-191-5/+2
| | | | hope don't happen. also, always check for errors. ok deraadt
* unifdef SETUIDSCRIPT and FDSCRIPT. we always use them. ok deraadttedu2014-11-181-27/+3
|
* use mallocarray for multiplied value checkingtedu2014-07-131-2/+2
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-2/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* 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@
* Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,guenther2012-02-151-2/+7
| | | | | | | | 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@
* Add new syscall entries to support the openat(2) family of functionsmatthew2011-07-071-1/+2
| | | | | | | | | | | | | | | | added in POSIX Issue 7: openat(), mknodat(), mkfifoat(), linkat(), symlinkat(), unlinkat(), faccessat(), fstatat(), readlinkat(), fchmodat(), fchownat(), utimensat(), renameat(), and mkdirat(). This diff mostly just refactors the existing sys_foo() logic into a common dofooat() function that can then be called by both sys_foo() and sys_fooat(). Some of the new system calls support new flags to control their behavior, and proper support for these will be added in subsequent diffs. Incorporating suggestions from thib@, guenther@, and tedu@. ok tedu@, thib@, deraadt@, guenther@
* MALLOC/FREE -> malloc/freechl2007-10-291-3/+3
| | | | | | replace an hard coded value with M_WAITOK ok krw@
* grammar, spelling, and style fixes from bret lambert;jmc2006-11-141-5/+5
| | | | kern_descrip.c change ok deraadt
* ansi. No binary change.jsg2005-11-121-4/+2
|
* - We shouldn't allocate MAXPATHLEN from the stack.art2005-08-011-11/+12
| | | | | - Don't copy the pathbuf into kernel space unless we're systracing. deraadt@ ok
* fix an issue when scripts are exec'd under systrace wheremarius2004-07-071-4/+16
| | | | | | | | | 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/+13
| | | | | | | | | | | | - 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
* use pool for namei pathbuf. testing ok millert@ tdeval@tedu2004-05-141-3/+4
|
* string fixes; tedu okderaadt2003-05-031-4/+4
|
* We can jump to the fail: label before shellargp is initialized.art2002-09-181-7/+8
| | | | | | Make sure that we don't free random memory when that happens. From <j at pureftpd.org> deraadt@ ok
* Change the vnode locking in exec to not keep the vnode locked almost allart2002-08-221-12/+13
| | | | | | | | | | | | | | the time. This could lead to problems when a process wants to do an exec on the same vnode it's being run from and needs to copy in arguments from an uncached page in the data segment. When that happens uvm detects a vnode deadlock and returns an error causing execve() return EFAULT. This fixes the regress test in regress/sys/kern/exec_self Also, initialize scriptvp early in exec_script because it could be used uninitialized in a failure case.
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-2/+2
| | | | (Look ma, I might have broken the tree)
* - every new fd created by falloc() is marked as larval and should not be usedart2001-10-261-1/+2
| | | | | | | any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
* KNFderaadt2001-06-221-12/+12
|
* ifdef FOO inside an ifdef FOO feels like overkill.art2001-05-141-2/+2
|
* Don't use MALLOC/FREE on variable sized allocations.art2000-09-261-5/+5
|
* remove superflous declaration of vnops, it's now in <sys/file.h>assar2000-02-011-2/+1
|
* force FDSCRIPTS after include files are pulled inderaadt1999-10-181-5/+5
|
* panic prints a newline for you, don't do it in the panic stringmillert1999-01-111-2/+2
|
* Updates for VFS Lite 2 + soft update.csapuntz1997-11-061-2/+2
|
* back out vfs lite2 till after 2.2deraadt1997-10-061-2/+2
|
* VFS Lite2 Changescsapuntz1997-10-061-2/+2
|
* Make it build with -Wparentheses.dm1996-10-201-2/+2
|
* warning: variable might be used uninitialized -- sucksderaadt1996-06-121-3/+3
|
* From NetBSD: 960217 mergeniklas1996-03-031-2/+5
|
* initial import of NetBSD treederaadt1995-10-181-0/+294