Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/sysv_sem.c
RevisionDateAuthorComments
 1.104  23-May-2025  hannken Fix typos in SEM_PRINTF(): usemid->semid, usops->sops, use NETBSD32PTR64().

Kernels ALL/i386 and ALL/amd64 build again.
 1.103  10-May-2025  riastradh sysv_sem.c: KNF
 1.102  09-May-2025  martin Split the common parts out of semop(2) handling, separating one time
initialization and everything doing copyin(9) from the common code
dealing with the syscall, so the common code can be reused for compat
code.
Part of PR 59352
 1.101  06-Oct-2024  mlelstv Use the syscall arg for IPCID_TO_SEQ like before.
 1.100  03-Oct-2024  christos rename for clarity.
 1.99  03-Oct-2024  christos Add semtimedop GSoC 2024 (Shivraj Jamgade)
 1.98  07-Aug-2019  pgoyette Many years ago someone created a new __link_set_sysctl_funcs to hold
the list of routines that need to be called for setting up sysctl
variables. This worked great for all code included in the kernel
itself, but didn't deal with modules that want to create their own
sysctl data. So, we ended up with a lot of #ifdef _MODULE blocks
so modules could explicitly call their setup functions when loaded
as non-built-in modules.

So today, we complete the task that was started so many years ago.

When modules are loaded, after we've called xxx_modcmd(INIT...) we
check if the module contains its own __link_set_sysctl_funcs, and
if so we call the functions listed. We add a struct sysctllog member
to the struct module so we can call sysctl_teardown() when the module
gets unloaded. (The sequence of events ensures that the sysctl stuff
doesn't get created until the rest of the module's init code does any
required memory allocation.)

So, no more need to explicitly call the sysctl setup routines when
built as a loadable module.
 1.97  10-Apr-2019  pgoyette Replace some "panic()" calls with simple "printf() ; return error"

There's no good reason for these build-time parameters to be allowed to
panic the kernel when it is easy to simply disable the module code and
fail gracefully.

While we're at it, similarly replace panic() when malloc fails to also
fail gracefully.
 1.96  21-Feb-2019  mrg for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.

besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.


while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.


XXX: the naming of compat functions have too many styles. there
are at least 3 different ones changed here.
 1.95  06-Nov-2015  pgoyette branches: 1.95.10; 1.95.18;
In sysv_sem.c, defer establishment of exithook so we can initialize the
module code from module_init() rather than waiting until after calling
exec_init(). Use a RUN_ONCE routine at entry to each sys_sem* syscall
to establish the exithook, and no longer KASSERT that the hook has
been set before removing it. (A manually loaded module can be unloaded
before any syscalls have been invoked.)

Remove the conditional calls to the various xxx_init() routines from
init_main.c - we now rely on module_init() to handle initialization.

Let each sub-component's xxx_init() routine handle its own sysctl
sub-tree initialization; this removes another set of #ifdef ugliness.

Tested both built-in and loadable versions and verified that atf
test kernel/t_sysv passes.
 1.94  13-May-2015  pgoyette More prep: add a xxxfini() routine to each subcomponent so we can
clean up after ourselves. Mostly, this checks to make sure that
there are no active itmes, and then deallocates wired kernel virtual
memory. For SYSVSEM, we also disestablish the exithook() so we
won't try to call it after destroying its memory pool!
 1.93  13-May-2015  pgoyette More preparation for modularizing the SYSVxxx options. Here we
change the kern.ipc.sysvxxx sysctls into dynamic values, so each
sub-component of SYSVxxx can declare its own availability.
 1.92  12-May-2015  pgoyette In preparation for modularization of the SYSV* options, restore the
use of opt_sysv.h to get the -DSYSVxxx definitions.
 1.91  05-Sep-2014  matt branches: 1.91.2;
Don't nest struct undo and change it to sem_undo_entry
 1.90  25-Feb-2014  pooka branches: 1.90.4; 1.90.6; 1.90.10;
Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.89  13-Mar-2012  elad branches: 1.89.2; 1.89.4;
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.88  30-Jul-2011  uebayasi branches: 1.88.2; 1.88.6;
Correct sizes to pass uvm_km_free(9) in error paths.
 1.87  13-May-2011  rmind Sprinkle __cacheline_aligned and __read_mostly.
 1.86  05-Oct-2009  rmind branches: 1.86.4; 1.86.6;
semu_alloc: simplify a little.
 1.85  11-Jan-2009  christos merge christos-time_t
 1.84  19-Sep-2008  rmind branches: 1.84.2;
Fix the aligning of memory blocks again, finally...
Tested by <martin> on his sparc64 box.
 1.83  06-May-2008  njoly branches: 1.83.2; 1.83.6;
- Make semctl SETVAL/SETALL commands validate the semaphore value to
be set, which needs to be in the range [0,SEMVMX].
- Adjust the man page.
 1.82  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.81  25-Apr-2008  ad branches: 1.81.2;
semexit: do nothing if the process has not used semaphores.
 1.80  22-Apr-2008  njoly Fix semaphore permissions returned by semctl+IPC_STAT, by masking
anything else that the expected lower 9 bits.
 1.79  02-Jan-2008  ad branches: 1.79.6; 1.79.8; 1.79.10;
Merge vmlocking2 to head.
 1.78  20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.77  08-Dec-2007  ad branches: 1.77.4;
Merge from vmlocking2: don't hold semlock across copyin().
 1.76  25-Nov-2007  rmind branches: 1.76.2;
- Retry the operations (instead of failing) in case of reallocation.
Suggested by <yamt>.
- Use predicts in checks for reallocation state.
 1.75  04-Nov-2007  yamt branches: 1.75.2;
fix deadlocks.
 1.74  04-Nov-2007  rmind Support for dynamic changing of SysV message queues and semaphores limits.
Also fixes the alignment problem, which was here forever. Thanks for <uwe>
for discussion and <martin> for testing.

Reviewed by: <tech-kern>, <gdt>
 1.73  17-Aug-2007  ad branches: 1.73.2; 1.73.6;
Remove obsolete comment.
 1.72  17-Aug-2007  skd Don't put the condvars in the *middle* of the undo structures.
(semu + seminfo.semmnu) is wrong, because the type of semu is int*.
You could fix the offset ((char *)semu + seminfo.semusz), but simply
putting the condvars first is more clear.
 1.71  04-Aug-2007  ad branches: 1.71.2;
Mark the SysV semaphore syscalls MP safe.
 1.70  09-Jul-2007  ad branches: 1.70.2; 1.70.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.69  17-Jun-2007  dsl Use get_semctl_arg() here instead of the switch statement.
 1.68  04-Mar-2007  christos branches: 1.68.2; 1.68.4; 1.68.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.67  09-Feb-2007  ad branches: 1.67.2;
Merge newlock2 to head.
 1.66  01-Nov-2006  yamt remove some __unused from function parameters.
 1.65  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.64  29-Sep-2006  christos Coverity CID 2951, 2953, 2954: Add KASSERTS before null deref
 1.63  23-Jul-2006  ad branches: 1.63.4; 1.63.6;
Use the LWP cached credentials where sane.
 1.62  07-Jun-2006  kardel merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.61  14-May-2006  elad branches: 1.61.2;
integrate kauth.
 1.60  15-Apr-2006  christos Coverity CID 840: Add KASSERT before deref.
 1.59  07-Dec-2005  thorpej branches: 1.59.4; 1.59.6; 1.59.8; 1.59.10; 1.59.12;
Use ANSI function delcs.
 1.58  10-Nov-2005  christos fix debugging.
 1.57  03-Nov-2005  chs fix the SYSV semop number of operations per request to be limited by
seminfo.semopm (which is tunable via the SEMOPM config variable)
rather than an arbitrary constant.
 1.56  01-Apr-2005  yamt branches: 1.56.2;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.55  07-Oct-2004  briggs branches: 1.55.4; 1.55.6; 1.55.10;
Update sem_otime on successful call to semop().
 1.54  05-Aug-2004  enami The different loop variable is no longer necessary due to recent change.
 1.53  23-Mar-2004  junyoung branches: 1.53.4;
Nuke __P().
 1.52  18-Mar-2004  enami - remove unnecessary code.
- factor out common code.
- don't stop searching before the target.
- touch the correct object.
- validate the argument before the loop otherwise we need to roll back.
 1.51  18-Mar-2004  enami Whitespace nits and wrap some lines.
 1.50  18-Mar-2004  christos PR/24814: Colin Percival: sysv_sem waiter counting problem
 1.49  29-Nov-2003  jdolecek fix semaphore ID bound checking
problem pointed and patch provided in kern/23585 by Jeff Ito
 1.48  26-Oct-2003  jdolecek allocate virtual memory for SYSV shm, msg and semaphore structures
separately from the bufpages, so that it would be possible to eventually
make their limits changeable in runtime

make static all local variables which do not need to be exported to other
kernel parts
 1.47  29-Jun-2003  fvdl branches: 1.47.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.46  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.45  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.44  17-Mar-2002  christos use the exithook mechanism to clean up semaphores.
 1.43  05-Mar-2002  nathanw Make the debugging printfs compile:
- printf format checking doesn't like %x for pointers; use %p like we should.
- LP64 fixes.
 1.42  12-Nov-2001  lukem add RCSIDs
 1.41  03-Aug-2001  jdolecek branches: 1.41.4;
make local 'nsops' same unsigned type as the value we store there in sys_semop()
 1.40  22-Jul-2000  simonb branches: 1.40.2; 1.40.4;
Delete a couple of <uvm/uvm_extern.h> includes that were for
<sys/sysctl.h> only.
 1.39  27-Jun-2000  mrg remove include of <vm/vm.h>
 1.38  02-Jun-2000  simonb branches: 1.38.2;
Add new sysctl node "KERN_SYSVIPC_INFO" with "KERN_SYSVIPC_MSG_INFO",
"KERN_SYSVIPC_SEM_INFO" and "KERN_SYSVIPC_SHM_INFO" to return the
info and data structures for the relevent SysV IPC types. The return
structures use fixed-size types and should be compat32 safe. All
user-visible changes are protected with
#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

Make all variable declarations extern in msg.h, sem.h and shm.h and
add relevent variable declarations to sysv_*.c and remove unneeded
header files from those .c files.

Make compat14 SysV IPC conversion functions and sysctl_file() static.

Change the data pointer to "void *" in sysctl_clockrate(),
sysctl_ntptime(), sysctl_file() and sysctl_doeproc().
 1.37  27-May-2000  sommerfeld Remove existing semaphore system locking mechanism and turn
sys_semconfig into a placebo system call, to avoid giving folks an
easy way to wedge processes which use semaphores.

NOTE: unlike 386bsd and freebsd, processes which did not have
semaphore undo records would not be affected by this problem (reducing
it from a serious local denial-of-service problem to a largely
cosmetic problem, since virtually nobody uses semaphores). But the
code is just Wrong so we're ripping it out anyway.
 1.36  27-May-2000  thorpej branches: 1.36.2;
sleep() -> tsleep()
 1.35  30-Mar-2000  augustss Get rid of register declarations.
 1.34  31-Jan-2000  christos __semctl13 -> ____semctl13 because this now is not called directly.
The fourth argument to it is a pointer to union semun not union semun,
because passing structs and unions to syscalls cannot be handled portably.
 1.33  25-Aug-1999  thorpej branches: 1.33.2;
Overhaul of the SVID IPC facilities, primarily to use the types specified
by the Single UNIX Specification version 2, rather than the SVR2-derived
types. While I was here, I did a namespace sweep to expose the constants
and strucutures, and structure members described by SUSv2; documentation
updates coming shortly.

Fixes kern/8158.
 1.32  21-Oct-1998  tron branches: 1.32.6;
No need to get definition of "SYSV..." from "opt_sysv.h" because they
must be set if these files are compiled.
 1.31  19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.30  04-Aug-1998  perry Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) -> memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
bcmp(x, y, z) -> memcmp(x, y, z)
bzero(x, y) -> memset(x, 0, y)
 1.29  07-May-1998  kleink Various SysV IPC prototype changes.
 1.28  13-Oct-1996  christos backout previous kprintf change
 1.27  10-Oct-1996  christos - Use debugging printf - macros instead if #ifdef #endif everywhere
- printf -> kprintf, sprintf -> ksprintf
 1.26  09-Feb-1996  christos More proto fixes
 1.25  04-Feb-1996  christos First pass at prototyping
 1.24  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.23  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.22  24-Jun-1995  christos Extracted all of the compat_xxx routines, and created a library [libcompat]
for them. There are a few #ifdef COMPAT_XX remaining, but they are not easy
or worth eliminating (yet).
 1.21  05-Jun-1995  pk We need some compat_10 routines if COMPAT_SUNOS is on (PR #1008).
 1.20  19-Mar-1995  mycroft Use %p.
 1.19  10-Dec-1994  mycroft Fix another bug pointed out by Daniel Boulet.
 1.18  05-Dec-1994  mycroft Make semlock_holder non-static.
 1.17  05-Dec-1994  mycroft Check for another error condition.
 1.16  05-Dec-1994  mycroft Fix thinko in previous commit.
 1.15  05-Dec-1994  mycroft Add a comment to make this a little clearer...
 1.14  05-Dec-1994  mycroft Merge changes from Daniel Boulet to avoid waiting for the semaphore lock in
semexit() if there are no undo records to process.
 1.13  05-Dec-1994  mycroft Move the wait loop into a separate function.
 1.12  05-Dec-1994  mycroft Fix the locking mechanism that got broken with the new syscall interface.
 1.11  04-Dec-1994  mycroft Make this code a little more consistent with itself.
 1.10  20-Oct-1994  cgd update for new syscall args description mechanism
 1.9  29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.8  25-May-1994  mycroft Generalize ipcperm() a little.
 1.7  25-May-1994  hpeyerl sysv_shm.c from Adam.
sysv_ipc.c from me.
and various sundry changes to make sysv_ipc.c fit in.
(somewhat untested and not very pleasant reading material)
 1.6  13-Feb-1994  mycroft Format police, the end.
 1.5  13-Feb-1994  mycroft Format police, second pass.
 1.4  13-Feb-1994  mycroft Format police, first pass.
 1.3  18-Dec-1993  mycroft Canonicalize all #includes.
 1.2  15-Nov-1993  cgd kill bogus test
 1.1  14-Nov-1993  cgd branches: 1.1.2;
Add the System V message queue and semaphore facilities. Implemented
by Daniel Boulet <danny@BouletFermat.ab.ca>
 1.1.2.5  27-Nov-1993  mycroft KNFify a bit.
 1.1.2.4  27-Nov-1993  mycroft Remove remaining sleep()s.
 1.1.2.3  15-Nov-1993  cgd update from trunk
 1.1.2.2  14-Nov-1993  cgd Update from trunk:
Add the System V message queue and semaphore facilities. Implemented
by Daniel Boulet <danny@BouletFermat.ab.ca>
 1.1.2.1  14-Nov-1993  cgd file sysv_sem.c was added on branch magnum on 1993-11-14 14:47:24 +0000
 1.32.6.1  01-Jun-2000  he Pull up revision 1.37 (requested by sommerfeld):
Remove existing semaphore system locking mechanism. This avoids
giving users a way to wedge processes which use semaphores (note:
this would only affect processes using semaphores). Fixes
SA#2000-004.
 1.33.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.36.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.38.2.1  16-Aug-2001  tv Pullup [jdolecek]:

sys/kern/sysv_sem.c 1.41

Make local variable "nsops" the same (unsigned) type as its syscall arg.
 1.40.4.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.4.3  16-Mar-2002  jdolecek Catch up with -current.
 1.40.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.4.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.40.2.5  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.40.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.40.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.40.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.40.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.41.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.47.2.10  11-Dec-2005  christos Sync with head.
 1.47.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.8  01-Apr-2005  skrll Sync with HEAD.
 1.47.2.7  19-Oct-2004  skrll Sync with HEAD
 1.47.2.6  21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.5  18-Sep-2004  skrll Sync with HEAD.
 1.47.2.4  18-Aug-2004  skrll Revert to passing struct proc for {exit,exec}hook.
 1.47.2.3  12-Aug-2004  skrll Sync with HEAD.
 1.47.2.2  03-Aug-2004  skrll Sync with HEAD
 1.47.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.53.4.1  12-Jan-2005  he Pull up revision 1.55 (requested by briggs in ticket #903):
Update sem_otime on successful call to semop().
Fixes long-standing bug in the SYSV semaphore code which
causes an example in Stevens' UNPv2 to fail when trying
to compensate for a race condition in a file locking
implementation.
 1.55.10.1  05-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #930):
sys/sys/sem.h: revision 1.20
sys/kern/sysv_sem.c: revision 1.57
fix the SYSV semop number of operations per request to be limited by
seminfo.semopm (which is tunable via the SEMOPM config variable)
rather than an arbitrary constant.
 1.55.6.1  25-Jan-2005  yamt convert to new apis.
 1.55.4.1  29-Apr-2005  kent sync with -current
 1.56.2.7  21-Jan-2008  yamt sync with head
 1.56.2.6  07-Dec-2007  yamt sync with head
 1.56.2.5  15-Nov-2007  yamt sync with head.
 1.56.2.4  03-Sep-2007  yamt sync with head.
 1.56.2.3  26-Feb-2007  yamt sync with head.
 1.56.2.2  30-Dec-2006  yamt sync with head.
 1.56.2.1  21-Jun-2006  yamt sync with head.
 1.59.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.59.10.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.59.10.2  19-Apr-2006  elad sync with head.
 1.59.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.59.8.3  11-Aug-2006  yamt sync with head
 1.59.8.2  26-Jun-2006  yamt sync with head.
 1.59.8.1  24-May-2006  yamt sync with head.
 1.59.6.3  01-Jun-2006  kardel Sync with head.
 1.59.6.2  22-Apr-2006  simonb Sync with head.
 1.59.6.1  04-Feb-2006  simonb Adapt for timecounters: mostly use get*time() and use "time_second"
instead of "time.tv_sec".
 1.59.4.1  09-Sep-2006  rpaulo sync with head
 1.61.2.1  19-Jun-2006  chap Sync with head.
 1.63.6.2  10-Dec-2006  yamt sync with head.
 1.63.6.1  22-Oct-2006  yamt sync with head
 1.63.4.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.63.4.1  18-Nov-2006  ad Sync with head.
 1.67.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.68.6.1  09-Dec-2007  reinoud Pullup to HEAD
 1.68.4.1  11-Jul-2007  mjf Sync with head.
 1.68.2.5  28-Nov-2007  rmind sys_semop: avoid doing copyin() with the lock held.
 1.68.2.4  04-Nov-2007  rmind - sys_semop: remove the usage of the kernel_lock;
- Mark the POSIX message queues as MP-safe;

OK by <ad>.
 1.68.2.3  20-Aug-2007  ad Sync with HEAD.
 1.68.2.2  15-Jul-2007  ad Sync with head.
 1.68.2.1  22-Apr-2007  ad Make the SysV semphores MP safe.
 1.70.6.5  09-Dec-2007  jmcneill Sync with HEAD.
 1.70.6.4  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.70.6.3  04-Nov-2007  jmcneill Sync with HEAD.
 1.70.6.2  03-Sep-2007  jmcneill Sync with HEAD.
 1.70.6.1  04-Aug-2007  jmcneill Sync with HEAD.
 1.70.2.2  03-Sep-2007  skrll Sync with HEAD.
 1.70.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.71.2.2  04-Aug-2007  ad Mark the SysV semaphore syscalls MP safe.
 1.71.2.1  04-Aug-2007  ad file sysv_sem.c was added on branch matt-mips64 on 2007-08-04 10:53:00 +0000
 1.73.6.1  13-Nov-2007  bouyer Sync with HEAD
 1.73.2.2  09-Jan-2008  matt sync with HEAD
 1.73.2.1  06-Nov-2007  matt sync with HEAD
 1.75.2.3  18-Feb-2008  mjf Sync with HEAD.
 1.75.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.75.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.76.2.3  26-Dec-2007  ad Sync with head.
 1.76.2.2  08-Dec-2007  ad Sync with head.
 1.76.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.77.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.79.10.1  18-May-2008  yamt sync with head.
 1.79.8.2  01-Nov-2008  christos Sync with head.
 1.79.8.1  29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.79.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.79.6.2  28-Sep-2008  mjf Sync with HEAD.
 1.79.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.81.2.3  11-Mar-2010  yamt sync with head
 1.81.2.2  04-May-2009  yamt sync with head.
 1.81.2.1  16-May-2008  yamt sync with head.
 1.83.6.1  19-Oct-2008  haad Sync with HEAD.
 1.83.2.3  10-Oct-2008  skrll Sync with HEAD.
 1.83.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.83.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.84.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.86.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.86.4.1  31-May-2011  rmind sync with head
 1.88.6.1  05-Apr-2012  mrg sync to latest -current.
 1.88.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.88.2.1  17-Apr-2012  yamt sync with head
 1.89.4.1  18-May-2014  rmind sync with head
 1.89.2.2  03-Dec-2017  jdolecek update from HEAD
 1.89.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.90.10.1  23-Feb-2019  martin Pull up following revision(s) (requested by mrg in ticket #1679):
sys/compat/sys/ipc.h: revision 1.6
sys/compat/sys/ipc.h: revision 1.7
sys/compat/sys/shm.h: revision 1.8
sys/kern/sysv_shm.c: revision 1.133
sys/compat/sys/sem.h: revision 1.7
sys/compat/linux/common/linux_ipc.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.38
sys/kern/sysv_sem.c: revision 1.96
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.28
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.29
sys/compat/linux32/common/linux32_ipccall.c: revision 1.12
sys/kern/sysv_msg.c: revision 1.73
sys/compat/sys/msg.h: revision 1.6

for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.
besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.

while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.

XXX: the naming of compat functions have too many styles. there
are at least 3 different ones changed here.

fix naming errors in previous. (this file is no longer compiled, but
this fix makes the pull up more obvious, before deleting this file.)

include libkern.h or strings.h. should fix i386 build issues.
 1.90.6.1  23-Feb-2019  martin Pull up following revision(s) (requested by mrg in ticket #1679):
sys/compat/sys/ipc.h: revision 1.6
sys/compat/sys/ipc.h: revision 1.7
sys/compat/sys/shm.h: revision 1.8
sys/kern/sysv_shm.c: revision 1.133
sys/compat/sys/sem.h: revision 1.7
sys/compat/linux/common/linux_ipc.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.38
sys/kern/sysv_sem.c: revision 1.96
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.28
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.29
sys/compat/linux32/common/linux32_ipccall.c: revision 1.12
sys/kern/sysv_msg.c: revision 1.73
sys/compat/sys/msg.h: revision 1.6

for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.
besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.

while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.

XXX: the naming of compat functions have too many styles. there
are at least 3 different ones changed here.

fix naming errors in previous. (this file is no longer compiled, but
this fix makes the pull up more obvious, before deleting this file.)

include libkern.h or strings.h. should fix i386 build issues.
 1.90.4.1  23-Feb-2019  martin Pull up following revision(s) (requested by mrg in ticket #1679):
sys/compat/sys/ipc.h: revision 1.6
sys/compat/sys/ipc.h: revision 1.7
sys/compat/sys/shm.h: revision 1.8
sys/kern/sysv_shm.c: revision 1.133
sys/compat/sys/sem.h: revision 1.7
sys/compat/linux/common/linux_ipc.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.38
sys/kern/sysv_sem.c: revision 1.96
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.28
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.29
sys/compat/linux32/common/linux32_ipccall.c: revision 1.12
sys/kern/sysv_msg.c: revision 1.73
sys/compat/sys/msg.h: revision 1.6

for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.
besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.

while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.

XXX: the naming of compat functions have too many styles. there
are at least 3 different ones changed here.

fix naming errors in previous. (this file is no longer compiled, but
this fix makes the pull up more obvious, before deleting this file.)

include libkern.h or strings.h. should fix i386 build issues.
 1.91.2.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.91.2.1  06-Jun-2015  skrll Sync with HEAD
 1.95.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.95.18.1  10-Jun-2019  christos Sync with HEAD
 1.95.10.1  23-Feb-2019  martin Pull up following revision(s) (requested by mrg in ticket #1195):
sys/compat/sys/ipc.h: revision 1.6
sys/compat/sys/ipc.h: revision 1.7
sys/compat/sys/shm.h: revision 1.8
sys/kern/sysv_shm.c: revision 1.133
sys/compat/sys/sem.h: revision 1.7
sys/compat/linux/common/linux_ipc.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.38
sys/kern/sysv_sem.c: revision 1.96
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.28
sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.29
sys/compat/linux32/common/linux32_ipccall.c: revision 1.12
sys/kern/sysv_msg.c: revision 1.73
sys/compat/sys/msg.h: revision 1.6

for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.
besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.

while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.

XXX: the naming of compat functions have too many styles. there
are at least 3 different ones changed here.

fix naming errors in previous. (this file is no longer compiled, but
this fix makes the pull up more obvious, before deleting this file.)

include libkern.h or strings.h. should fix i386 build issues.

RSS XML Feed