summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_shm.c
Commit message (Collapse)AuthorAgeFilesLines
* return foo -> return (foo)alfred2002-08-151-22/+22
|
* Change struct vmspace->vm_shm from void * to struct shmmap_state *, thisalfred2002-07-221-3/+3
| | | | removes the need for casts in several cases.
* Remove caddr_t.alfred2002-07-221-12/+12
|
* Remove __P.alfred2002-03-191-17/+17
|
* - Use td_ucred for jail checks.jhb2002-03-051-29/+14
| | | | | | | | - Move jail checks and some other checks involving constants and stack variables out from under Giant. This isn't perfectly safe atm because jail_sysvipc_allowed is read w/o a lock meaning that its value could be stale. This global variable will soon become a per-jail flag, however, at which time it will either not need a lock or will use the prison lock.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-1/+1
| | | | reference.
* Make AIO a loadable module.alfred2001-12-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit call to aio_proc_rundown() from exit1(), instead AIO will use at_exit(9). Add functions at_exec(9), rm_at_exec(9) which function nearly the same as at_exec(9) and rm_at_exec(9), these functions are called on behalf of modules at the time of execve(2) after the image activator has run. Use a modified version of tegge's suggestion via at_exec(9) to close an exploitable race in AIO. Fix SYSCALL_MODULE_HELPER such that it's archetecuterally neutral, the problem was that one had to pass it a paramater indicating the number of arguments which were actually the number of "int". Fix it by using an inline version of the AS macro against the syscall arguments. (AS should be available globally but we'll get to that later.) Add a primative system for dynamically adding kqueue ops, it's really not as sophisticated as it should be, but I'll discuss with jlemon when he's around.
* Introduce [IPC|SHM]_[INFO|STAT] to shmctl to makemr2001-10-281-1/+44
| | | | `/compat/linux/usr/bin/ipcs -m` happy.
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-101-2/+1
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* PR: kern/29698 (part)mr2001-09-131-0/+7
| | | | | | | Reviewed by: audit Add tunables for the sem* and shm* syscontrols for tuning on boottime until they become dynamic. SAP R/3 doesn't like the compiled in defaults.
* KSE Milestone 2julian2001-09-121-51/+41
| | | | | | | | | | | | | | 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
* Giant Pushdown: sysv shm, sem, and msg calls.dillon2001-08-311-59/+137
|
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-13/+11
| | | | | | | | | (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.
* Export via sysctl:dd2001-05-301-0/+10
| | | | | | | | | | | * all members of msginfo from sysv_msg.c; * msqids from sysv_msg.c; * sema from sysv_sem.c; and * shmsegs from sysv_shm.c; These will be used by ipcs(1) in non-kvm mode. Reviewed by: tmm
* Correct style bugs with regards to long lines and comments.dd2001-05-231-15/+22
| | | | Reviewed by: bde
* Correct the vm_mtx handling; specifically, don't acquire it indd2001-05-221-5/+13
| | | | | | | | shm_deallocate_segment because shmexit_myhook calls it, and the latter should always be called with it already held. Submitted by: dwmalone, dd Approved by: alfred
* Sort includes.jhb2001-05-211-1/+1
|
* Aquire vm mutex when releasing sysv shm segments.alfred2001-05-201-0/+4
| | | | Obtained from: Dima Dorfman <dima@unixfreak.org>
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+6
| | | | | | | | | | | | | | | | | | | 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
* Raise the SysV shared memory defaults to more reasonable values.dillon2001-05-041-3/+3
| | | | | | Mainly increases the shared memory limit from 4M to 32M (approx). Many more programs these days use SysV shared memory, especially X-related programs.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-2/+2
| | | | | | | | | | | 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)
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project
* It is _DEFINITELY_ not okay to change shmseg on a running system.green2001-02-041-1/+1
|
* Use predictable internal names for the sysvipc modules, so we have ades2001-01-141-3/+4
| | | | chance of getting dependencies working.
* sysvipc loadable.alfred2000-12-011-8/+62
| | | | | | new syscall entry lkmressys - "reserved loadable syscall" Make syscall_register allow overwriting of such entries (lkmressys).
* o Deny access to System V IPC from within jail by default, as in therwatson2000-10-311-0/+19
| | | | | | | | | | | | current implementation, jail neither virtualizes the Sys V IPC namespace, nor provides inter-jail protections on IPC objects. o Support for System V IPC can be enabled by setting jail.sysvipc_allowed=1 using sysctl. o This is not the "real fix" which involves virtualizing the System V IPC namespace, but prevents processes within jail from influencing those outside of jail when not approved by the administrator. Reported by: Paulo Fragoso <paulo@nlink.com.br>
* This is a cleanup patch to Peter's new OBJT_PHYS VM object typedillon2000-05-291-7/+10
| | | | | | | | | | | | | | | | | and sysv shared memory support for it. It implements a new PG_UNMANAGED flag that has slightly different characteristics from PG_FICTICIOUS. A new sysctl, kern.ipc.shm_use_phys has been added to enable the use of physically-backed sysv shared memory rather then swap-backed. Physically backed shm segments are not tracked with PV entries, allowing programs which use a large shm segment as a rendezvous point to operate without eating an insane amount of KVM in the PV entry management. Read: Oracle. Peter's OBJT_PHYS object will also allow us to eventually implement page-table sharing and/or 4MB physical page support for such segments. We're half way there.
* Provide a temporary undocumented option: SHM_PHYS_BACKED. This willpeter2000-05-211-0/+5
| | | | | become sysctl and/or flags controlled later. It's mainly here for an easy place to test the physical memory backed objects.
* Make sysv-style shared memory tuneable params fully runtime adjustablepeter2000-03-301-23/+81
| | | | | | | | via sysctl. It's done pretty simply but it should be quite adequate. Also move SHMMAXPGS from $machine/include/vmparam.h as the comments that went with it were wrong... we don't allocate KVM space for the pages so that comment is bogus.. The only practical limit is how much physical ram you want to lock up as this stuff isn't paged out or swap backed.
* shmat: If VM_PROT_READ_IS_EXEC is defined and prot includes VM_PROT_READ,alc2000-03-101-0/+4
| | | | | | | | | | | VM_PROT_EXECUTE must be added to prot before calling vm_map_find. Without this change, an mprotect on a shmat'ed region fails (when it shouldn't). This bug was reported Feb 28 by Brooks Davis <brooks@one-eyed-alien.net> on -hackers. Reviewed by: bde Approved by: jkh
* useracc() the prequel:phk1999-10-291-2/+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.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* For consistency with other implementations, check for the existencealc1999-06-191-3/+3
| | | | | | | of the segment before checking its permissions. PR: kern/11999 Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
* Change suser_xxx() to suser() where it applies.phk1999-04-271-11/+7
|
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-1/+2
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Fixed two potentially serious classes of bugs:dg1998-10-131-4/+3
| | | | | | | | | | | | | | | | 1) The vnode pager wasn't properly tracking the file size due to "size" being page rounded in some cases and not in others. This sometimes resulted in corrupted files. First noticed by Terry Lambert. Fixed by changing the "size" pager_alloc parameter to be a 64bit byte value (as opposed to a 32bit page index) and changing the pagers and their callers to deal with this properly. 2) Fixed a bogus type cast in round_page() and trunc_page() that caused some 64bit offsets and sizes to be scrambled. Removing the cast required adding casts at a few dozen callers. There may be problems with other bogus casts in close-by macros. A quick check seemed to indicate that those were okay, however.
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-3/+3
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Fix the shm panic. I mistakenly used the shadow_count to keep the objectdyson1998-05-041-3/+2
| | | | from being split, and instead added an OBJ_NOSPLIT.
* Work around some VM bugs, the worst being an overly aggressivedyson1998-05-041-1/+5
| | | | | swap space free calculation. More complete fixes will be forthcoming, in a week.
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Staticize.eivind1998-02-091-2/+2
|
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+2
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-31/+23
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Removed unused #includes.bde1997-08-021-4/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Make DFLDSIZ and MAXDSIZ fully-supported options.joerg1996-12-221-1/+2
| | | | "Don't forget to do a ``make depend''" :-)
OpenPOWER on IntegriCloud