summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_aout.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the fields in the sysentvec and in the vm map header in place of thejake2002-09-211-4/+4
| | | | | | | | constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS. This is mainly so that they can be variable even for the native abi, based on different machine types. Get stack protections from the sysentvec too. This makes it trivial to map the stack non-executable for certain abis, on machines that support it.
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-101-8/+5
| | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes.
* Tidy up some loose ends that bde pointed out. caddr_t bad, ok?peter2002-09-071-7/+7
| | | | | | | Move fill_kinfo_proc to before we copy the results instead of after the copy and too late. There is still more to do here.
* The true value of how the kernel was configured for KSTACK_PAGES was notpeter2002-09-071-8/+6
| | | | | | available at module compile time. Do not #include the bogus opt_kstack_pages.h at this point and instead refer to the variables that are also exported via sysctl.
* Collect the a.out coredump code into the calling functions.peter2002-09-071-1/+16
| | | | XXX why does pecoff dump in a.out format?
* Added fields for VM_MIN_ADDRESS, PS_STRINGS and stack protections tojake2002-09-011-6/+24
| | | | | | sysentvec. Initialized all fields of all sysentvecs, which will allow them to be used instead of constants in more places. Provided stack fixup routines for emulations that previously used the default.
* In order to better support flexible and extensible access control,rwatson2002-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make a series of modifications to the credential arguments relating to file read and write operations to cliarfy which credential is used for what: - Change fo_read() and fo_write() to accept "active_cred" instead of "cred", and change the semantics of consumers of fo_read() and fo_write() to pass the active credential of the thread requesting an operation rather than the cached file cred. The cached file cred is still available in fo_read() and fo_write() consumers via fp->f_cred. These changes largely in sys_generic.c. For each implementation of fo_read() and fo_write(), update cred usage to reflect this change and maintain current semantics: - badfo_readwrite() unchanged - kqueue_read/write() unchanged pipe_read/write() now authorize MAC using active_cred rather than td->td_ucred - soo_read/write() unchanged - vn_read/write() now authorize MAC using active_cred but VOP_READ/WRITE() with fp->f_cred Modify vn_rdwr() to accept two credential arguments instead of a single credential: active_cred and file_cred. Use active_cred for MAC authorization, and select a credential for use in VOP_READ/WRITE() based on whether file_cred is NULL or not. If file_cred is provided, authorize the VOP using that cred, otherwise the active credential, matching current semantics. Modify current vn_rdwr() consumers to pass a file_cred if used in the context of a struct file, and to always pass active_cred. When vn_rdwr() is used without a file_cred, pass NOCRED. These changes should maintain current semantics for read/write, but avoid a redundant passing of fp->f_cred, as well as making it more clear what the origin of each credential is in file descriptor read/write operations. Follow-up commits will make similar changes to other file descriptor operations, and modify the MAC framework to pass both credentials to MAC policy modules so they can implement either semantic for revocation. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* - Hold the vnode lock throughout execve.jeff2002-08-131-4/+0
| | | | | - Set VV_TEXT in the top level execve code. - Fixup the image activators to deal with the newly locked vnode.
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-1/+2
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Infrastructure tweaks to allow having both an Elf32 and an Elf64 executablepeter2002-07-201-1/+1
| | | | | | | | | | | | | | | handler in the kernel at the same time. Also, allow for the exec_new_vmspace() code to build a different sized vmspace depending on the executable environment. This is a big help for execing i386 binaries on ia64. The ELF exec code grows the ability to map partial pages when there is a page size difference, eg: emulating 4K pages on 8K or 16K hardware pages. Flesh out the i386 emulation support for ia64. At this point, the only binary that I know of that fails is cvsup, because the cvsup runtime tries to execute code in pages not marked executable. Obtained from: dfr (mostly, many tweaks from me).
* Clean up execve locking:jeff2002-07-061-1/+1
| | | | | | - Grab the vnode object early in exec when we still have the vnode lock. - Cache the object in the image_params. - Make use of the cached object in imgact_*.c
* - Change fill_kinfo_proc() to require that the process is locked when itjhb2002-04-091-0/+2
| | | | | | | | | | | | | | is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
* Remove __P.alfred2002-03-191-1/+1
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-1/+1
| | | | reference.
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-101-1/+1
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* Make uio_yield() a global. Call uio_yield() between chunksdillon2001-09-261-2/+2
| | | | | | | | | | | | | | in vn_rdwr_inchunks(), allowing other processes to gain an exclusive lock on the vnode. Specifically: directory scanning, to avoid a race to the root directory, and multiple child processes coring simultaniously so they can figure out that some other core'ing child has an exclusive adv lock and just exit instead. This completely fixes performance problems when large programs core. You can have hundreds of copies (forked children) of the same binary core all at once and not notice. MFC after: 3 days
* KSE Milestone 2julian2001-09-121-11/+15
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* This brings in a Yahoo coredump patch from Paul, with additional mods bydillon2001-09-081-4/+4
| | | | | | | | | | | | | | | | | | | me (addition of vn_rdwr_inchunks). The problem Yahoo is solving is that if you have large process images core dumping, or you have a large number of forked processes all core dumping at the same time, the original coredump code would leave the vnode locked throughout. This can cause the directory vnode to get locked up, which can cause the parent directory vnode to get locked up, and so on all the way to the root node, locking the entire machine up for extremely long periods of time. This patch solves the problem in two ways. First it uses an advisory non-blocking lock to abort multiple processes trying to core to the same file. Second (my contribution) it chunks up the writes and uses bwillwrite() to avoid holding the vnode locked while blocking in the buffer cache. Submitted by: ps Reviewed by: dillon MFC after: 2 weeks
* Optionize UPAGES for the i386. As part of this I split some of the lowpeter2001-08-251-0/+2
| | | | | | | | | | level implementation stuff out of machine/globaldata.h to avoid exposing UPAGES to lots more places. The end result is that we can double the kernel stack size with 'options UPAGES=4' etc. This is mainly being done for the benefit of a MFC to RELENG_4 at some point. -current doesn't really need this so much since each interrupt runs on its own kstack.
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-8/+2
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+8
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-3/+5
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Back out proc locking to protect p_ucred for obtaining additionaljhb2001-01-271-6/+1
| | | | references along with the actual obtaining of additional references.
* Proc locking.jhb2001-01-241-1/+7
|
* Change the proc information returned from the kernel so that itmckusick2000-12-121-2/+1
| | | | | | | | | | | | no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced.
* Make MINSIGSTKSZ machine dependent, and have the sigaltstackmarcel2000-11-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | syscall compare against a variable sv_minsigstksz in struct sysentvec as to properly take the size of the machine- and ABI dependent struct sigframe into account. The SVR4 and iBCS2 modules continue to have a minsigstksz of 8192 to preserve behavior. The real values (if different) are not known at this time. Other ABI modules use the real values. The native MINSIGSTKSZ is now defined as follows: Arch MINSIGSTKSZ ---- ----------- alpha 4096 i386 2048 ia64 12288 Reviewed by: mjacob Suggested by: bde
* Add three new VOPs: VOP_CREATEVOBJECT, VOP_DESTROYVOBJECT and VOP_GETVOBJECT.bp2000-09-121-1/+1
| | | | | | | They will be used by nullfs and other stacked filesystems to support full cache coherency. Reviewed in general by: mckusick, dillon
* Move the include of <sys/systm.h> so that KTR gets a declaration fordfr2000-09-101-1/+1
| | | | snprintf().
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* s/p_cred->pc_ucred/p_ucred/gphk1999-11-211-1/+1
|
* useracc() the prequel:phk1999-10-291-1/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* Trim unused options (or #ifdef for undoc options).peter1999-10-111-1/+0
| | | | Submitted by: phk
* Fixed style regressions in previous commit.bde1999-09-041-6/+4
|
* General cleanup of core-dumping code.julian1999-09-011-37/+7
| | | | Submitted by: Sean Fagan,
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Don't follow symlinks on coredumps.dima1999-08-261-3/+3
| | | | Reviewed by: dillon && security-officer
* Add the options MAP_PREFAULT and MAP_PREFAULT_PARTIAL to vm_map_find/insert,alc1999-05-171-7/+3
| | | | | | | eliminating the need for the pmap_object_init_pt calls in imgact_* and mmap. Reviewed by: David Greenman <dg@root.com>
* Simplify vm_map_find/insert's interface: remove the MAP_COPY_NEEDED option.alc1999-05-141-3/+3
| | | | | | | It never makes sense to specify MAP_COPY_NEEDED without also specifying MAP_COPY_ON_WRITE, and vice versa. Thus, MAP_COPY_ON_WRITE suffices. Reviewed by: David Greenman <dg@root.com>
* Fix a couple of warnings and some bitrot in comments.peter1999-05-091-3/+1
|
* Restore support for executing BSD/OS binaries on the i386 by passingjdp1999-04-031-1/+4
| | | | | | | | the address of the ps_strings structure to the process via %ebx. For other kinds of binaries, %ebx is still zeroed as before. Submitted by: Thomas Stephens <tas@stephens.org> Reviewed by: jdp
* For clarity, use the "map" variable introduced by the last commitalc1999-03-101-5/+5
| | | | throughout exec_aout_imgact.
* exec_aout_imgact should lock the vm_map before calling vm_map_insert.alc1999-03-041-6/+15
| | | | | | Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>, "John S. Dyson" <dyson@iquest.net>, and David Greenman <dg@root.com>
* Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). Thisluoqi1999-02-191-2/+2
| | | | | | | is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
* *_execsw static structures cannot be const due to the way they interactdillon1999-01-291-2/+2
| | | | | | with EXEC_SET, DECLARE_MODULE, and module_register. Specifically, module_register. We may eventually be able to make these const, but not now.
* Fixed bitrot in a comment. Fixed some style bugs.bde1999-01-011-5/+3
|
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-2/+2
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Add provisions for variant core dump file formats, depending on thejdp1998-09-141-1/+95
| | | | | | | | | | | object format of the executable being dumped. This is the first step toward producing ELF core dumps in the proper format. I will commit the code to generate the ELF core dumps Real Soon Now. In the meantime, ELF executables won't dump core at all. That is probably no less useful than dumping a.out-style core dumps as they have done until now. Submitted by: Alex <garbanzo@hooked.net> (with very minor changes by me)
* Cast u_longs to uintptr_t before casting them to pointers. Don'tbde1998-07-151-3/+4
| | | | | attempt to even partially support systems with function pointers larger than object pointers.
* Removed unused #includes.bde1998-02-201-3/+1
|
* Fixed staticization.bde1998-02-031-2/+2
|
OpenPOWER on IntegriCloud