/[base]/head/sys/kern/sysv_msg.c
ViewVC logotype

Log of /head/sys/kern/sysv_msg.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:


Revision 365222 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 1 22:12:32 2020 UTC (9 months, 4 weeks ago) by mjg
File length: 49817 byte(s)
Diff to previous 363051
kern: clean up empty lines in .c and .h files


Revision 363051 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 9 17:26:49 2020 UTC (11 months, 3 weeks ago) by markj
File length: 49818 byte(s)
Diff to previous 357312
Avoid copying out kernel pointers from msgctl(IPC_STAT).

While this behaviour is harmless, it is really just an artifact of the
fact that the msgctl(2) implementation uses a user-visible structure as
part of the internal implementation, so it is not deliberate and these
pointers are not useful to userspace.  Thus, NULL them out before
copying out, and remove references to them from the manual page.

Reported by:	Jeffball <jeffball@grimm-co.com>
Reviewed by:	emaste, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25600


Revision 357312 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 30 20:05:05 2020 UTC (17 months ago) by mjg
File length: 49605 byte(s)
Diff to previous 334486
Remove duplicated empty lines from kern/*.c

No functional changes.


Revision 334486 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 1 13:26:45 2018 UTC (3 years, 1 month ago) by emaste
File length: 49607 byte(s)
Diff to previous 333833
ANSIfy sys/kern


Revision 333833 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 19 03:56:39 2018 UTC (3 years, 1 month ago) by mmacy
File length: 49644 byte(s)
Diff to previous 332122
sysv_msg initialize saved_msgsz


Revision 332122 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 6 17:35:35 2018 UTC (3 years, 2 months ago) by brooks
File length: 49640 byte(s)
Diff to previous 330297
Move most of the contents of opt_compat.h to opt_global.h.

opt_compat.h is mentioned in nearly 180 files. In-progress network
driver compabibility improvements may add over 100 more so this is
closer to "just about everywhere" than "only some files" per the
guidance in sys/conf/options.

Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of
sys/compat/linux/*.c.  A fake _COMPAT_LINUX option ensure opt_compat.h
is created on all architectures.

Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the
set of compiled files.

Reviewed by:	kib, cem, jhb, jtl
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14941


Revision 330297 - (view) (download) (annotate) - [select for diffs]
Modified Fri Mar 2 22:10:48 2018 UTC (3 years, 4 months ago) by brooks
File length: 49664 byte(s)
Diff to previous 329525
Rename kernel-only members of semid_ds and msgid_ds.

This deliberately breaks the API in preperation for future syscall
revisions which will remove these nonstandard members.

In an exp-run a single port (devel/qemu-user-static) was found to
use them which it did becuase it emulates system calls.  This has
been fixed in the ports tree.

PR:		224443 (exp-run)
Reviewed by:	kib, jhb (previous version)
Exp-run by:	antoine
Sponsored by:	DARPA, AFRP
Differential Revision:	https://reviews.freebsd.org/D14490


Revision 329525 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 18 19:19:36 2018 UTC (3 years, 4 months ago) by brooks
File length: 49576 byte(s)
Diff to previous 328799
Correct/improve the descriptions if kern.ipc.(shmsegs,sema,msqids).

The description of kern.ipc.shmsegs was wrong since 2005.  I updated the
others (which were more correct) to match.

PR:		225933
Reviewed by:	cem
MFC after:	3 days
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14391


Revision 328799 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 2 18:03:12 2018 UTC (3 years, 4 months ago) by brooks
File length: 49528 byte(s)
Diff to previous 326271
Add kern.ipc.{msqids,semsegs,sema} sysctls for FreeBSD32.

Stop leaking kernel pointers though theses sysctls and make sure that the
padding in the structures is zeroed on allocation to avoid other leaks.

Reviewed by:	gordon, kib
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D13459


Revision 326271 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 27 15:20:12 2017 UTC (3 years, 7 months ago) by pfg
File length: 48461 byte(s)
Diff to previous 318389
sys/kern: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


Revision 318389 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 17 00:34:34 2017 UTC (4 years, 1 month ago) by emaste
File length: 48409 byte(s)
Diff to previous 316308
Remove register keyword from sys/ and ANSIfy prototypes

A long long time ago the register keyword told the compiler to store
the corresponding variable in a CPU register, but it is not relevant
for any compiler used in the FreeBSD world today.

ANSIfy related prototypes while here.

Reviewed by:	cem, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D10193


Revision 316308 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 30 22:26:15 2017 UTC (4 years, 3 months ago) by rwatson
File length: 48621 byte(s)
Diff to previous 316185
Audit arguments to System V IPC system calls implementing sempahores,
message queues, and shared memory.

Obtained from:	TrustedBSD Project
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL


Revision 316185 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 29 23:31:35 2017 UTC (4 years, 3 months ago) by rwatson
File length: 47944 byte(s)
Diff to previous 301737
When handling msgsys(2), semsys(2), and shmsys(2) multiplex system calls,
map the 'which' argument into a suitable audit event identifier for the
specific operation requested.

Obtained from:	TrustedBSD Project
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL


Revision 301737 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 9 15:34:33 2016 UTC (5 years ago) by jamie
File length: 47838 byte(s)
Diff to previous 298661
Remove a comment that was part of copied code, and is misleading in
the new location.


Revision 298661 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 26 19:57:35 2016 UTC (5 years, 2 months ago) by cem
File length: 48054 byte(s)
Diff to previous 298656
osd(9): Change array pointer to array pointer type from void*

This is a minor follow-up to r297422, prompted by a Coverity warning.  (It's
not a real defect, just a code smell.)  OSD slot array reservations are an
array of pointers (void **) but were cast to void* and back unnecessarily.
Keep the correct type from reservation to use.

osd.9 is updated to match, along with a few trivial igor fixes.

Reported by:	Coverity
CID:		1353811
Sponsored by:	EMC / Isilon Storage Division


Revision 298656 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 26 18:17:44 2016 UTC (5 years, 2 months ago) by jamie
File length: 48053 byte(s)
Diff to previous 298649
Redo the changes to the SYSV IPC sysctl functions from r298585, so they
don't (mis)use sbufs.

PR:		48471


Revision 298649 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 26 15:38:17 2016 UTC (5 years, 2 months ago) by pfg
File length: 48302 byte(s)
Diff to previous 298585
sys: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.


Revision 298585 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 25 17:06:50 2016 UTC (5 years, 2 months ago) by jamie
File length: 48317 byte(s)
Diff to previous 298354
Encapsulate SYSV IPC objects in jails.  Define per-module parameters
sysvmsg, sysvsem, and sysvshm, with the following bahavior:

inherit: allow full access to the IPC primitives.  This is the same as
the current setup with allow.sysvipc is on.  Jails and the base system
can see (and moduly) each other's objects, which is generally considered
a bad thing (though may be useful in some circumstances).

disable: all no access, same as the current setup with allow.sysvipc off.

new: A jail may see use the IPC objects that it has created.  It also
gets its own IPC key namespace, so different jails may have their own
objects using the same key value.  The parent jail (or base system) can
see the jail's IPC objects, but not its keys.

PR:		48471
Submitted by:	based on work by kikuchan98@gmail.com
MFC after:	5 days


Revision 298354 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 20 16:19:44 2016 UTC (5 years, 2 months ago) by pfg
File length: 40909 byte(s)
Diff to previous 298310
Indentation issues.

Contract some lines leftover from r298310.

Mea culpa.


Revision 298310 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 19 23:48:27 2016 UTC (5 years, 2 months ago) by pfg
File length: 40914 byte(s)
Diff to previous 282213
kernel: use our nitems() macro when it is available through param.h.

No functional change, only trivial cases are done in this sweep,

Discussed in:	freebsd-current


Revision 282213 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 29 10:23:02 2015 UTC (6 years, 2 months ago) by trasz
File length: 40934 byte(s)
Diff to previous 273707
Add kern.racct.enable tunable and RACCT_DISABLED config option.
The point of this is to be able to add RACCT (with RACCT_DISABLED)
to GENERIC, to avoid having to rebuild the kernel to use rctl(8).

Differential Revision:	https://reviews.freebsd.org/D2369
Reviewed by:	kib@
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation


Revision 273707 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 26 19:42:44 2014 UTC (6 years, 8 months ago) by mjg
File length: 40847 byte(s)
Diff to previous 267992
Avoid dynamic syscall overhead for statically compiled modules.

The kernel tracks syscall users so that modules can safely unregister them.

But if the module is not unloadable or was compiled into the kernel, there is
no need to do this.

Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC
during kernel build and 0 otherwise.

Reviewed by:	kib (previous version)
MFC after:	2 weeks


Revision 267992 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 28 03:56:17 2014 UTC (7 years ago) by hselasky
File length: 40809 byte(s)
Diff to previous 267985
Pull in r267961 and r267973 again. Fix for issues reported will follow.


Revision 267985 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 27 22:05:21 2014 UTC (7 years ago) by gjb
File length: 41090 byte(s)
Diff to previous 267961
Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory


Revision 267961 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 27 16:33:43 2014 UTC (7 years ago) by hselasky
File length: 40809 byte(s)
Diff to previous 225617
Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies


Revision 225617 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 16 13:58:51 2011 UTC (9 years, 9 months ago) by kmacy
File length: 41090 byte(s)
Diff to previous 223825
In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by:	rwatson
Approved by:	re (bz)


Revision 223825 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 6 20:06:44 2011 UTC (9 years, 11 months ago) by trasz
File length: 41038 byte(s)
Diff to previous 220399
All the racct_*() calls need to happen with the proc locked.  Fixing this
won't happen before 9.0.  This commit adds "#ifdef RACCT" around all the
"PROC_LOCK(p); racct_whatever(p, ...); PROC_UNLOCK(p)" instances, in order
to avoid useless locking/unlocking in kernels built without "options RACCT".


Revision 220399 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 6 19:08:50 2011 UTC (10 years, 2 months ago) by trasz
File length: 40958 byte(s)
Diff to previous 220398
Style fix.

Submitted by:	jhb@


Revision 220398 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 6 18:11:24 2011 UTC (10 years, 2 months ago) by trasz
File length: 40966 byte(s)
Diff to previous 220388
Add accounting for SysV-related resources.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (earlier version)


Revision 220388 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 6 16:59:54 2011 UTC (10 years, 2 months ago) by trasz
File length: 39910 byte(s)
Diff to previous 219028
Add ucred pointer to the SysV-related memory structures.  This is required
for racct.

Note that after this commit, ipcs(1) needs to be rebuilt.  Otherwise, it will
fail with "ipcs: sysctlbyname: kern.ipc.msqids: Cannot allocate memory".

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (earlier version)


Revision 219028 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 25 10:11:01 2011 UTC (10 years, 4 months ago) by netchild
File length: 39820 byte(s)
Diff to previous 217555
Add some FEATURE macros for various features (AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/
PMC/SYSV/...).

No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.

Sponsored by:   Google Summer of Code 2010
Submitted by:   kibab
Reviewed by:    arch@ (parts by rwatson, trasz, jhb)
X-MFC after:    to be determined in last commit with code from this project


Revision 217555 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 18 21:14:18 2011 UTC (10 years, 5 months ago) by mdf
File length: 39765 byte(s)
Diff to previous 216104
Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.


Revision 216104 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 2 01:14:45 2010 UTC (10 years, 7 months ago) by trasz
File length: 39748 byte(s)
Diff to previous 205323
Remove useless NULL checks for M_WAITOK mallocs.


Revision 205323 - (view) (download) (annotate) - [select for diffs]
Modified Fri Mar 19 11:04:42 2010 UTC (11 years, 3 months ago) by kib
File length: 40097 byte(s)
Diff to previous 194910
Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding
sysv_{msg,sem,shm}.c files.

Mark SysV IPC freebsd32 syscalls as NOSTD and add required
SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto
register/unregister on module load.

This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded
as modules.

Reviewed by:	jhb
MFC after:	2 weeks


Revision 194910 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 24 21:10:52 2009 UTC (12 years ago) by jhb
File length: 34487 byte(s)
Diff to previous 194894
Change the ABI of some of the structures used by the SYSV IPC API:
- The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned
  short.
- The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned
  short.
- The mode member of struct ipc_perm is now mode_t instead of unsigned short
  (this is merely a style bug).
- The rather dubious padding fields for ABI compat with SV/I386 have been
  removed from struct msqid_ds and struct semid_ds.
- The shm_segsz member of struct shmid_ds is now a size_t instead of an
  int.  This removes the need for the shm_bsegsz member in struct
  shmid_kernel and should allow for complete support of SYSV SHM regions
  >= 2GB.
- The shm_nattch member of struct shmid_ds is now an int instead of a
  short.
- The shm_internal member of struct shmid_ds is now gone.  The internal
  VM object pointer for SHM regions has been moved into struct
  shmid_kernel.
- The existing __semctl(), msgctl(), and shmctl() system call entries are
  now marked COMPAT7 and new versions of those system calls which support
  the new ABI are now present.
- The new system calls are assigned to the FBSD-1.1 version in libc.  The
  FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls.
- A simplistic framework for tagging system calls with compatibility
  symbol versions has been added to libc.  Version tags are added to
  system calls by adding an appropriate __sym_compat() entry to
  src/lib/libc/incldue/compat.h. [1]

PR:		kern/16195 kern/113218 bin/129855
Reviewed by:	arch@, rwatson
Discussed with:	kan, kib [1]


Revision 194894 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 24 20:01:13 2009 UTC (12 years ago) by jhb
File length: 32876 byte(s)
Diff to previous 194832
Deprecate the msgsys(), semsys(), and shmsys() system calls by moving
them under COMPAT_FREEBSD[4567].  Starting with FreeBSD 5.0 the SYSV IPC
API was implemented via direct system calls (e.g. msgctl(), msgget(), etc.)
rather than indirecting through the var-args *sys() system calls.  The
shmsys() system call was already effectively deprecated for all but
COMPAT_FREEBSD4 already as its implementation for the !COMPAT_FREEBSD4 case
was to simply invoke nosys().


Revision 194832 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 24 13:35:38 2009 UTC (12 years ago) by jhb
File length: 32642 byte(s)
Diff to previous 194575
- Move syscall function argument structure types to be just above the
  relevenat system call function.
- Whitespace fixes.


Revision 194575 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 21 07:54:47 2009 UTC (12 years ago) by rdivacky
File length: 32643 byte(s)
Diff to previous 193511
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang.

	if (cond);		<--- note the trailing ;
	   something();

Approved by:	ed (mentor)
Discussed on:	current@


Revision 193511 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 5 14:55:22 2009 UTC (12 years ago) by rwatson
File length: 32635 byte(s)
Diff to previous 192895
Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC
and used in a large number of files, but also because an increasing number
of incorrect uses of MAC calls were sneaking in due to copy-and-paste of
MAC-aware code without the associated opt_mac.h include.

Discussed with:	pjd


Revision 192895 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 27 14:11:23 2009 UTC (12 years, 1 month ago) by jamie
File length: 32656 byte(s)
Diff to previous 172930
Add hierarchical jails.  A jail may further virtualize its environment
by creating a child jail, which is visible to that jail and to any
parent jails.  Child jails may be restricted more than their parents,
but never less.  Jail names reflect this hierarchy, being MIB-style
dot-separated strings.

Every thread now points to a jail, the default being prison0, which
contains information about the physical system.  Prison0's root
directory is the same as rootvnode; its hostname is the same as the
global hostname, and its securelevel replaces the global securelevel.
Note that the variable "securelevel" has actually gone away, which
should not cause any problems for code that properly uses
securelevel_gt() and securelevel_ge().

Some jail-related permissions that were kept in global variables and
set via sysctls are now per-jail settings.  The sysctls still exist for
backward compatibility, used only by the now-deprecated jail(2) system
call.

Approved by:	bz (mentor)


Revision 172930 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 24 19:04:04 2007 UTC (13 years, 8 months ago) by rwatson
File length: 32656 byte(s)
Diff to previous 170587
Merge first in a series of TrustedBSD MAC Framework KPI changes
from Mac OS X Leopard--rationalize naming for entry points to
the following general forms:

  mac_<object>_<method/action>
  mac_<object>_check_<method/action>

The previous naming scheme was inconsistent and mostly
reversed from the new scheme.  Also, make object types more
consistent and remove spaces from object types that contain
multiple parts ("posix_sem" -> "posixsem") to make mechanical
parsing easier.  Introduce a new "netinet" object type for
certain IPv4/IPv6-related methods.  Also simplify, slightly,
some entry point names.

All MAC policy modules will need to be recompiled, and modules
not updates as part of this commit will need to be modified to
conform to the new KPI.

Sponsored by:	SPARTA (original patches against Mac OS X)
Obtained from:	TrustedBSD Project, Apple Computer


Revision 170587 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 12 00:12:01 2007 UTC (14 years ago) by rwatson
File length: 32666 byte(s)
Diff to previous 167232
Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in
some cases, move to priv_check() if it was an operation on a thread and
no other flags were present.

Eliminate caller-side jail exception checking (also now-unused); jail
privilege exception code now goes solely in kern_jail.c.

We can't yet eliminate suser() due to some cases in the KAME code where
a privilege check is performed and then used in many different deferred
paths.  Do, however, move those prototypes to priv.h.

Reviewed by:	csjp
Obtained from:	TrustedBSD Project


Revision 167232 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 5 13:10:58 2007 UTC (14 years, 4 months ago) by rwatson
File length: 32705 byte(s)
Diff to previous 167211
Further system call comment cleanup:

- Remove also "MP SAFE" after prior "MPSAFE" pass. (suggested by bde)
- Remove extra blank lines in some cases.
- Add extra blank lines in some cases.
- Remove no-op comments consisting solely of the function name, the word
  "syscall", or the system call name.
- Add punctuation.
- Re-wrap some comments.


Revision 167211 - (view) (download) (annotate) - [select for diffs]
Modified Sun Mar 4 22:36:48 2007 UTC (14 years, 4 months ago) by rwatson
File length: 32709 byte(s)
Diff to previous 166829
Remove 'MPSAFE' annotations from the comments above most system calls: all
system calls now enter without Giant held, and then in some cases, acquire
Giant explicitly.

Remove a number of other MPSAFE annotations in the credential code and
tweak one or two other adjacent comments.


Revision 166829 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 19 13:23:45 2007 UTC (14 years, 4 months ago) by rwatson
File length: 32789 byte(s)
Diff to previous 165403
Do allow privilege to create over-sized messages on System V IPC
message queues in jail.


Revision 165403 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 20 19:26:30 2006 UTC (14 years, 6 months ago) by jkim
File length: 32750 byte(s)
Diff to previous 164368
MFP4: (part of) 110058

copyin()/copyout() for message type is separated from msgsnd()/msgrcv() and
it is done from its wrapper functions to support 32-bit emulations.  After I
implemented this, I have briefly referenced NetBSD and Darwin.  NetBSD passes
copyin()/copyout() function pointers from wrappers.  Darwin passes size of
message type as an argument, which is actually similar to my first
implementation (P4 109706).  We may revisit these implementations later.


Revision 164368 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 17 20:43:01 2006 UTC (14 years, 7 months ago) by jkim
File length: 32730 byte(s)
Diff to previous 164033
Fix msgsnd(3)/msgrcv(3) deadlock under heavy resource pressure by timing out
msgsnd and rechecking resources.  This problem was found while I was running
Linux Test Project test suite (test cases: msgctl08, msgctl09).
Change `msgwait' to `msgsnd' and `msgrcv' to distinguish its sleeping
conditions.  Few cosmetic changes to debugging messages.


Revision 164033 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 6 13:42:10 2006 UTC (14 years, 7 months ago) by rwatson
File length: 32624 byte(s)
Diff to previous 163606
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>


Revision 163606 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 22 11:52:19 2006 UTC (14 years, 8 months ago) by rwatson
File length: 32579 byte(s)
Diff to previous 162468
Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h
begun with a repo-copy of mac.h to mac_framework.h.  sys/mac.h now
contains the userspace and user<->kernel API and definitions, with all
in-kernel interfaces moved to mac_framework.h, which is now included
across most of the kernel instead.

This change is the first step in a larger cleanup and sweep of MAC
Framework interfaces in the kernel, and will not be MFC'd.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA


Revision 162468 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 20 13:40:00 2006 UTC (14 years, 9 months ago) by rwatson
File length: 32559 byte(s)
Diff to previous 159481
Remove MAC_DEBUG + MPRINTF debugging from System V IPC.  This no longer
appears to be serving a useful purpose, as it was used during initial
development of MAC support for System V IPC.

MFC after:	1 month
Obtained from:	TrustedBSD Project
Suggested by:	Christopher dot Vance at SPARTA dot com


Revision 159481 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 10 14:34:07 2006 UTC (15 years ago) by rwatson
File length: 33217 byte(s)
Diff to previous 141710
Move some functions and definitions from uipc_socket2.c to uipc_socket.c:

- Move sonewconn(), which creates new sockets for incoming connections on
  listen sockets, so that all socket allocate code is together in
  uipc_socket.c.

- Move 'maxsockets' and associated sysctls to uipc_socket.c with the
  socket allocation code.

- Move kern.ipc sysctl node to uipc_socket.c, add a SYSCTL_DECL() for it
  to sysctl.h and remove lots of scattered implementations in various
  IPC modules.

- Sort sodealloc() after soalloc() in uipc_socket.c for dependency order
  reasons.  Statisticize soalloc() and sodealloc() as they are now
  required only in uipc_socket.c, and are internal to the socket
  implementation.

After this change, socket allocation and deallocation is entirely
centralized in one file, and uipc_socket2.c consists entirely of socket
buffer manipulation and default protocol switch functions.

MFC after:	1 month


Revision 141710 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 12 01:22:39 2005 UTC (16 years, 4 months ago) by csjp
File length: 33241 byte(s)
Diff to previous 141471
Add much needed descriptions for a number of the IPC related sysctl OIDs.
This information will be very useful for people who are tuning applications
which have a dependence on IPC mechanisms.

The following OIDs were documented:

Message queues:
 kern.ipc.msgmax
 kern.ipc.msgmni
 kern.ipc.msgmnb
 kern.ipc.msgtlq
 kern.ipc.msgssz
 kern.ipc.msgseg

Semaphores:
 kern.ipc.semmap
 kern.ipc.semmni
 kern.ipc.semmns
 kern.ipc.semmnu
 kern.ipc.semmsl
 kern.ipc.semopm
 kern.ipc.semume
 kern.ipc.semusz
 kern.ipc.semvmx
 kern.ipc.semaem

Shared memory:
 kern.ipc.shmmax
 kern.ipc.shmmin
 kern.ipc.shmmni
 kern.ipc.shmseg
 kern.ipc.shmall
 kern.ipc.shm_use_phys
 kern.ipc.shm_allow_removed
 kern.ipc.shmsegs

These new descriptions can be viewed using sysctl -d

PR:		kern/65219
Submitted by:	Dan Nelson <dnelson at allantgroup dot com> (modified)
No objections:	developers@
Descriptions reviewed by: gnn
MFC after:	1 week


Revision 141471 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 7 18:44:55 2005 UTC (16 years, 4 months ago) by jhb
File length: 33037 byte(s)
Diff to previous 140839
- Tweak kern_msgctl() to return a copy of the requested message queue id
  structure in the struct pointed to by the 3rd argument for IPC_STAT and
  get rid of the 4th argument.  The old way returned a pointer into the
  kernel array that the calling function would then access afterwards
  without holding the appropriate locks and doing non-lock-safe things like
  copyout() with the data anyways.  This change removes that unsafeness and
  resulting race conditions as well as simplifying the interface.
- Implement kern_foo wrappers for stat(), lstat(), fstat(), statfs(),
  fstatfs(), and fhstatfs().  Use these wrappers to cut out a lot of
  code duplication for freebsd4 and netbsd compatability system calls.
- Add a new lookup function kern_alternate_path() that looks up a filename
  under an alternate prefix and determines which filename should be used.
  This is basically a more general version of linux_emul_convpath() that
  can be shared by all the ABIs thus allowing for further reduction of
  code duplication.


Revision 140839 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 26 00:46:36 2005 UTC (16 years, 5 months ago) by sobomax
File length: 33108 byte(s)
Diff to previous 140614
Split out kernel side of msgctl(2) into two parts: the first that pops data
from the userland and pushes results back and the second which does
actual processing. Use the latter to eliminate stackgap in the linux wrapper
of that syscall.

MFC after:      2 weeks


Revision 140614 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 22 18:51:43 2005 UTC (16 years, 5 months ago) by rwatson
File length: 32840 byte(s)
Diff to previous 139804
Invoke label initialization, creation, cleanup, and tear-down MAC
Framework entry points for System V IPC message queues.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research


Revision 139804 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 6 23:35:40 2005 UTC (16 years, 5 months ago) by imp
File length: 27814 byte(s)
Diff to previous 139436
/* -> /*- for copyright notices, minor format tweaks as necessary


Revision 139436 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 30 13:56:34 2004 UTC (16 years, 6 months ago) by rwatson
File length: 27813 byte(s)
Diff to previous 137613
Make the sysctls kern.ipc.msgmnb and kern.ipc.msgtql into tunables as
is the case for most other sysctls in the System V IPC message queue
implementation.

PR:		75541
Submitted by:	Sergiy Vyshnevetskiy <serg at vostok dot net>
MFC after:	2 weeks


Revision 137613 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 12 13:23:47 2004 UTC (16 years, 7 months ago) by rwatson
File length: 27695 byte(s)
Diff to previous 129882
Second of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Use _kernel variants on _ds structures for System V sempahores, message
queues, and shared memory.  When interfacing with userspace, export
only the _ds subsets of the _kernel data structures.  A lot of search
and replace.

Define the message structure in the _KERNEL portion of msg.h so that it
can be used by other kernel consumers, but not exposed to user space.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research


Revision 129882 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 30 20:34:58 2004 UTC (17 years, 1 month ago) by phk
File length: 27602 byte(s)
Diff to previous 122201
Add missing #include <sys/module.h>


Revision 122201 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 7 04:47:14 2003 UTC (17 years, 7 months ago) by rwatson
File length: 27578 byte(s)
Diff to previous 121307
Slight whitespace consistency improvement:
  Trim trailing whitespace.
  Remove unmatched " " before ")".


Revision 121307 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 21 18:28:36 2003 UTC (17 years, 8 months ago) by silby
File length: 27579 byte(s)
Diff to previous 118615
Change all SYSCTLS which are readonly and have a related TUNABLE
from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide
more useful error messages.


Revision 118615 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 7 16:42:27 2003 UTC (17 years, 10 months ago) by nectar
File length: 27570 byte(s)
Diff to previous 116182
Update some argument-documenting comments to match reality.

Add an explicit range check to those same arguments to reduce risk of
cardiac arrest in future code readers.


Revision 116182 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 11 00:56:59 2003 UTC (18 years ago) by obrien
File length: 27549 byte(s)
Diff to previous 111119
Use __FBSDID().


Revision 111119 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 19 05:47:46 2003 UTC (18 years, 4 months ago) by imp
File length: 27519 byte(s)
Diff to previous 109906
Back out M_* changes, per decision of the TRB.

Approved by: trb


Revision 109906 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jan 26 23:25:00 2003 UTC (18 years, 5 months ago) by alfred
File length: 27491 byte(s)
Diff to previous 109895
fix warnings


Revision 109895 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jan 26 20:09:34 2003 UTC (18 years, 5 months ago) by alfred
File length: 27479 byte(s)
Diff to previous 109623
Add const qualifier to data argument for msgsnd.

PR: standards/45274
Submitted by: Craig Rodrigues <rodrigc@attbi.com>


Revision 109623 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 21 08:56:16 2003 UTC (18 years, 5 months ago) by alfred
File length: 27467 byte(s)
Diff to previous 107896
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


Revision 107896 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 15 09:41:46 2002 UTC (18 years, 6 months ago) by maxim
File length: 27495 byte(s)
Diff to previous 101772
o Clear a high bit of ipc_perm.seq so msgget(3) never returns a
negative message queue id.

PR:		kern/46122
Submitted by:	Vladimir B.Grebenschikov <vova@sw.ru>
MFC after:	2 weeks


Revision 101772 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 13 08:00:36 2002 UTC (18 years, 10 months ago) by alfred
File length: 27459 byte(s)
Diff to previous 100523
Make SYSVMSG mpsafe.  Right now there is a global lock over the
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.


Revision 100523 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 22 18:27:54 2002 UTC (18 years, 11 months ago) by alfred
File length: 27064 byte(s)
Diff to previous 100511
Cleanup:
Define a debug printf macro rather than wrapping all calls to printf
with #ifdefs.


Revision 100511 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 22 16:12:55 2002 UTC (18 years, 11 months ago) by alfred
File length: 28269 byte(s)
Diff to previous 100076
Remove caddr_t.


Revision 100076 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 15 13:17:23 2002 UTC (18 years, 11 months ago) by markm
File length: 28407 byte(s)
Diff to previous 93593
Consistently use semicolons to terminate macro invocations. Cleaner
style and fixes later warnings.


Revision 93593 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 1 21:31:13 2002 UTC (19 years, 3 months ago) by jhb
File length: 28406 byte(s)
Diff to previous 92723
Change the suser() API to take advantage of td_ucred as well as do a
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@


Revision 92723 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 19 21:25:46 2002 UTC (19 years, 3 months ago) by alfred
File length: 28409 byte(s)
Diff to previous 91703
Remove __P.


Revision 91703 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 5 18:57:36 2002 UTC (19 years, 4 months ago) by jhb
File length: 28433 byte(s)
Diff to previous 88633
- Use td_ucred for jail checks.
- 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.


Revision 88633 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 29 07:13:47 2001 UTC (19 years, 6 months ago) by alfred
File length: 28596 byte(s)
Diff to previous 83765
Make AIO a loadable module.

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.


Revision 83765 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 21 09:25:17 2001 UTC (19 years, 9 months ago) by mr
File length: 28611 byte(s)
Diff to previous 83366
Make msgseg, msgssz (->msgmax) and msgmni TUNABLE.


Revision 83366 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 12 08:38:13 2001 UTC (19 years, 9 months ago) by julian
File length: 28391 byte(s)
Diff to previous 82607
KSE Milestone 2
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


Revision 82607 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 31 00:02:18 2001 UTC (19 years, 10 months ago) by dillon
File length: 28277 byte(s)
Diff to previous 80670
Giant Pushdown:  sysv shm, sem, and msg calls.


Revision 80670 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 30 19:28:02 2001 UTC (19 years, 11 months ago) by asmodai
File length: 27369 byte(s)
Diff to previous 77461
Fix obsolete code.

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


Revision 77461 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 30 03:28:59 2001 UTC (20 years, 1 month ago) by dd
File length: 27473 byte(s)
Diff to previous 72786
Export via sysctl:
  * 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


Revision 72786 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 21 06:39:57 2001 UTC (20 years, 4 months ago) by rwatson
File length: 26746 byte(s)
Diff to previous 71038
o Move per-process jail pointer (p->pr_prison) to inside of the subject
  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


Revision 71038 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jan 14 18:04:30 2001 UTC (20 years, 5 months ago) by des
File length: 26751 byte(s)
Diff to previous 69644
Use predictable internal names for the sysvipc modules, so we have a
chance of getting dependencies working.


Revision 69644 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 5 23:05:45 2000 UTC (20 years, 7 months ago) by alfred
File length: 26745 byte(s)
Diff to previous 69449
Add forgotten SYSCALL_MODULE_HELPER() for msgsys() syscall.

Discovered by: Valentin Chopov <valentin@valcho.net>


Revision 69449 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 1 08:57:47 2000 UTC (20 years, 7 months ago) by alfred
File length: 26711 byte(s)
Diff to previous 68024
sysvipc loadable.

new syscall entry lkmressys - "reserved loadable syscall"

Make syscall_register allow overwriting of such entries (lkmressys).


Revision 68024 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 31 01:34:00 2000 UTC (20 years, 8 months ago) by rwatson
File length: 25473 byte(s)
Diff to previous 66085
o Deny access to System V IPC from within jail by default, as in the
  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>


Revision 66085 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 19 22:59:22 2000 UTC (20 years, 9 months ago) by peter
File length: 25096 byte(s)
Diff to previous 59839
Fully initialize msqids[].  This could lead to ENOSPC and other strange
stuff.

PR: 21085
Submitted by:  Marcin Cieslak <saper@SYSTEM.PL>


Revision 59839 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 1 13:33:56 2000 UTC (21 years, 2 months ago) by peter
File length: 25065 byte(s)
Diff to previous 50477
Move the MSG* and SEM* options to opt_sysvipc.h
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.


Revision 50477 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 28 01:08:13 1999 UTC (21 years, 10 months ago) by peter
File length: 23087 byte(s)
Diff to previous 46116
$Id$ -> $FreeBSD$


Revision 46116 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 27 12:21:16 1999 UTC (22 years, 2 months ago) by phk
File length: 23130 byte(s)
Diff to previous 46112
Change suser_xxx() to suser() where it applies.


Revision 46112 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 27 11:18:52 1999 UTC (22 years, 2 months ago) by phk
File length: 23272 byte(s)
Diff to previous 45921
Suser() simplification:

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.


Revision 45921 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 21 13:30:01 1999 UTC (22 years, 2 months ago) by sada
File length: 23267 byte(s)
Diff to previous 43426
The function msgrcv() could copy larger data than it should do
under some circumstances.
PR:		kern/10765
Submitted by:	Yasuhito FUTATSUKI <futatuki@fureai.or.jp>


Revision 43426 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 30 12:21:49 1999 UTC (22 years, 5 months ago) by phk
File length: 23255 byte(s)
Diff to previous 34961
Use suser() to determine super-user-ness, don't examine cr_uid directly.


Revision 34961 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 30 09:56:58 1998 UTC (23 years, 3 months ago) by phk
File length: 23220 byte(s)
Diff to previous 30994
Eradicate the variable "time" from the kernel, using various measures.
"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


Revision 30994 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 6 19:29:57 1997 UTC (23 years, 7 months ago) by phk
File length: 23220 byte(s)
Diff to previous 27845
Move the "retval" (3rd) parameter from all syscall functions and put
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.


Revision 27845 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 2 14:33:27 1997 UTC (23 years, 11 months ago) by bde
File length: 23364 byte(s)
Diff to previous 22975
Removed unused #includes.


Revision 22975 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 22 09:48:43 1997 UTC (24 years, 4 months ago) by peter
File length: 23340 byte(s)
Diff to previous 21673
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.


Revision 21673 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 14 07:20:47 1997 UTC (24 years, 5 months ago) by jkh
File length: 23345 byte(s)
Diff to previous 17971
Make the long-awaited change from $Id$ to $FreeBSD$

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.


Revision 17971 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 31 14:48:13 1996 UTC (24 years, 10 months ago) by bde
File length: 23392 byte(s)
Diff to previous 13255
Don't depend in the kernel on the gcc feature of doing arithmetic on
pointers of type `void *'.  Warn about this in future.


Revision 13255 - (view) (download) (annotate) - [select for diffs]
Added Fri Jan 5 16:38:03 1996 UTC (25 years, 6 months ago) by wollman
File length: 23314 byte(s)
Diff to previous 12866
Somehow managed to miss these four files when converting the SYSV IPC
options over to the new style.



This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27