FreeBSD src
Go to file
Robert Watson 800c940832 Add a new priv(9) kernel interface for checking the availability of
privilege for threads and credentials.  Unlike the existing suser(9)
interface, priv(9) exposes a named privilege identifier to the privilege
checking code, allowing more complex policies regarding the granting of
privilege to be expressed.  Two interfaces are provided, replacing the
existing suser(9) interface:

suser(td)                 ->   priv_check(td, priv)
suser_cred(cred, flags)   ->   priv_check_cred(cred, priv, flags)

A comprehensive list of currently available kernel privileges may be
found in priv.h.  New privileges are easily added as required, but the
comments on adding privileges found in priv.h and priv(9) should be read
before doing so.

The new privilege interface exposed sufficient information to the
privilege checking routine that it will now be possible for jail to
determine whether a particular privilege is granted in the check routine,
rather than relying on hints from the calling context via the
SUSER_ALLOWJAIL flag.  For now, the flag is maintained, but a new jail
check function, prison_priv_check(), is exposed from kern_jail.c and used
by the privilege check routine to determine if the privilege is permitted
in jail.  As a result, a centralized list of privileges permitted in jail
is now present in kern_jail.c.

The MAC Framework is now also able to instrument privilege checks, both
to deny privileges otherwise granted (mac_priv_check()), and to grant
privileges otherwise denied (mac_priv_grant()), permitting MAC Policy
modules to implement privilege models, as well as control a much broader
range of system behavior in order to constrain processes running with
root privilege.

The suser() and suser_cred() functions remain implemented, now in terms
of priv_check() and the PRIV_ROOT privilege, for use during the transition
and possibly continuing use by third party kernel modules that have not
been updated.  The PRIV_DRIVER privilege exists to allow device drivers to
check privilege without adopting a more specific privilege identifier.

This change does not modify the actual security policy, rather, it
modifies the interface for privilege checks so changes to the security
policy become more feasible.

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>
2006-11-06 13:37:19 +00:00
bin When parsing an invalid parameter expansion (eg. ${} or ${foo@bar}) do not 2006-11-05 18:36:05 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r163976, 2006-11-04 07:53:25 +00:00
crypto Don't define XAUTH_PATH here, we either pass it in on the compiler command 2006-10-06 14:27:26 +00:00
etc Switch default proto to TCP. 2006-11-06 01:42:11 +00:00
games Squash a typo. 2006-10-30 12:01:57 +00:00
gnu Remove gratuitous white space change. 2006-11-06 02:49:19 +00:00
include Hook up gjournal bits to the build. 2006-10-31 22:22:30 +00:00
kerberos5 Kerberos/Heimdal doesn't really depend on the INET6 macro. 2006-07-28 06:33:27 +00:00
lib Eliminate documentation references to a non-existent function. 2006-11-06 00:28:46 +00:00
libexec Fix TLS on sparc64 for statically and dynamically linked binaries 2006-10-08 02:50:34 +00:00
release Updated release note: em(4) 6.2.9. 2006-11-04 02:01:52 +00:00
rescue Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
sbin - I forgot to bump a date. 2006-11-05 20:12:32 +00:00
secure Fix static compilation. 2006-10-07 17:32:05 +00:00
share Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
sys Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
tools Regress.out is now regress.x.out. 2006-11-06 08:49:43 +00:00
usr.bin Avoid negative array indices: an empty string can also be used 2006-11-06 11:03:43 +00:00
usr.sbin Properly htole16() PSM in sockaddr_l2cap 2006-11-02 18:57:09 +00:00
COPYRIGHT Happy new year, a little late 2006-01-15 22:06:10 +00:00
LOCKS Document commit constraints for RELENG_6_*. 2006-01-13 06:51:43 +00:00
MAINTAINERS Add myself as OpenSSL janitor/maintainer. 2006-09-11 19:39:46 +00:00
Makefile When building an upgraded make, don't worry about processing it for 2006-11-01 09:05:40 +00:00
Makefile.inc1 Add sun4v to the TARGET_ARCH when just TARGET is set (like pc98 is done). 2006-10-16 22:18:13 +00:00
ObsoleteFiles.inc The rune interface was removed by tjr over two years ago. 2006-11-05 00:39:56 +00:00
README Simply running ``make world'' will bomb unless you dig up the 2006-06-07 03:33:48 +00:00
UPDATING Add 'options KSE' to the kernel config DEFAULTS on all arches/machines 2006-10-26 22:05:25 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html