summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_msg.c
Commit message (Collapse)AuthorAgeFilesLines
* fix warningsalfred2003-01-261-2/+2
|
* Add const qualifier to data argument for msgsnd.alfred2003-01-261-2/+2
| | | | | PR: standards/45274 Submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* o Clear a high bit of ipc_perm.seq so msgget(3) never returns amaxim2002-12-151-1/+1
| | | | | | | | negative message queue id. PR: kern/46122 Submitted by: Vladimir B.Grebenschikov <vova@sw.ru> MFC after: 2 weeks
* Make SYSVMSG mpsafe. Right now there is a global lock over thealfred2002-08-131-19/+31
| | | | | | | | | | entire subsystem, we could move to per-message queue locks, however the messages themselves seem to come from a global pool and to avoid over-locking this code (locking individual queues, then the global pool) I've opted to just do it this way. Requested by: rwatson Tested by: NetBSD's regression suite.
* Cleanup:alfred2002-07-221-184/+83
| | | | | Define a debug printf macro rather than wrapping all calls to printf with #ifdefs.
* Remove caddr_t.alfred2002-07-221-16/+14
|
* Consistently use semicolons to terminate macro invocations. Cleanermarkm2002-07-151-1/+1
| | | | style and fixes later warnings.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove __P.alfred2002-03-191-4/+4
|
* - Use td_ucred for jail checks.jhb2002-03-051-30/+17
| | | | | | | | - 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.
* 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.
* Make msgseg, msgssz (->msgmax) and msgmni TUNABLE.mr2001-09-211-0/+5
|
* KSE Milestone 2julian2001-09-121-35/+30
| | | | | | | | | | | | | | 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-86/+158
|
* Fix obsolete code.asmodai2001-07-301-5/+0
| | | | | | | | FreeBSD _does_ define ENOMSG, so no need for checking if we support it. Inspired by PR: 22470 Which was submitted by: Bjorn Tornqvist <bjorn@west.se> MFC after: 1 week
* Export via sysctl:dd2001-05-301-0/+18
| | | | | | | | | | | * 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
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use predictable internal names for the sysvipc modules, so we have ades2001-01-141-3/+4
| | | | chance of getting dependencies working.
* Add forgotten SYSCALL_MODULE_HELPER() for msgsys() syscall.alfred2000-12-051-0/+1
| | | | Discovered by: Valentin Chopov <valentin@valcho.net>
* sysvipc loadable.alfred2000-12-011-4/+69
| | | | | | 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/+16
| | | | | | | | | | | | 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>
* Fully initialize msqids[]. This could lead to ENOSPC and other strangepeter2000-09-191-0/+1
| | | | | | | stuff. PR: 21085 Submitted by: Marcin Cieslak <saper@SYSTEM.PL>
* Move the MSG* and SEM* options to opt_sysvipc.hpeter2000-05-011-36/+93
| | | | | | | | | | | | | | | Remove evil allocation macros from machdep.c (why was that there???) and use malloc() instead. Move paramters out of param.h and into the code itself. Move a bunch of internal definitions from public sys/*.h headers (without #ifdef _KERNEL even) into the code itself. I had hoped to make some of this more dynamic, but the cost of doing wakeups on all sleeping processes on old arrays was too frightening. The other possibility is to initialize on the first use, and allow dynamic sysctl changes to parameters right until that point. That would allow /etc/rc.sysctl to change SEM* and MSG* defaults as we presently do with SHM*, but without the nightmare of changing a running system.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Change suser_xxx() to suser() where it applies.phk1999-04-271-11/+8
|
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* The function msgrcv() could copy larger data than it should dosada1999-04-211-3/+3
| | | | | | under some circumstances. PR: kern/10765 Submitted by: Yasuhito FUTATSUKI <futatuki@fureai.or.jp>
* Use suser() to determine super-user-ness, don't examine cr_uid directly.phk1999-01-301-3/+6
|
* 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
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-20/+15
| | | | | | | | | | | | 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.
* Removed unused #includes.bde1997-08-021-3/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* 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.
* Don't depend in the kernel on the gcc feature of doing arithmetic onbde1996-08-311-5/+5
| | | | pointers of type `void *'. Warn about this in future.
* Somehow managed to miss these four files when converting the SYSV IPCwollman1996-01-051-1/+3
| | | | options over to the new style.
* Update sysv_*.c to get their argument definitions from sysproto.hpeter1995-12-151-13/+23
|
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-5/+5
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Start including <sys/sysproto.h> to get the correct args structs andbde1995-10-211-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prototypes for all syscalls. The args structs are still declared in comments as in VOP implementation functions. I don't like the duplication for this, but several more layers of changes are required to get it right. First we need to catch up with 4.4lite2, which uses macros to handle struct padding. Then we need to catch up with NetBSD, which passes the args correctly (as void *). Then we need to handle varargs functions and struct padding better. I think all the details can be hidden in machine-generated functions so that the args structs and verbose macros to reference them don't have to appear in the core sources. Add prototypes. Add bogus casts to hide the evil type puns exposed by the previous steps. &uap[1] was used to get at the args after the first. This worked because only the first arg in *uap was declared. This broke when the machine- genenerated args struct declared all the args (actually it declares extra args in some cases and depends on the user stack having some accessible junk after the last arg, not to mention the user args being on the stack. It isn't possible to declare a correct args struct for a varargs syscall). The msgsys(), semsys() and shmsys() syscall interfaces are BAD because they multiplex several syscalls that have different types of args. There was no reason to duplicate this sysv braindamage but now we're stuck with it. NetBSD has reimplemented the syscalls properly as separate syscalls #220-231. Declare static functions as static in both their prototype and their implementation (the latter is optional, and this misfeature was used). Remove gratuitous #includes. Continue cleaning up new init stuff.
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofdg1995-09-091-3/+3
| | | | compiler warnings.
* Fix several sysinit functions that had the wrong type and unnecessarilybde1995-08-301-7/+4
| | | | | | | | | external linkage. Remove useless comments saying that SYSINIT() does system initialization. shm.c: Remove nearly useless comment that gave wrong pseudo-prototypes.
* Reviewed by: julian with quick glances by bruce and othersjulian1995-08-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file.
* Eliminate sloppy common-style declarations. There should be none left forbde1995-07-291-1/+5
| | | | the LINT configuation.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* All of this is cosmetic. prototypes, #includes, printfs and so on. Makesphk1994-10-021-3/+2
| | | | GCC a lot more silent.
* Got rid of compiler warnings.dg1994-09-171-11/+4
|
* Added SYSV ipcs.dfr1994-09-131-0/+1006
Obtained from: NetBSD and FreeBSD-1.1.5
OpenPOWER on IntegriCloud