freebsd-skq/sys
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
..
amd64 Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
arm MFp4: 2006-11-03 07:39:37 +00:00
boot Major rework of the ia64 loaders. The two primary objectives are: 2006-11-05 22:03:04 +00:00
bsm Merge OpenBSM 1.0 alpha 12 import changes into src/sys/bsm. New events 2006-09-25 12:22:07 +00:00
cam Remove extra whitespace 2006-11-03 05:42:15 +00:00
coda Since DELAY() was moved, most <machine/clock.h> #includes have been 2006-05-16 14:37:58 +00:00
compat Regen. 2006-11-03 21:23:33 +00:00
conf Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
contrib Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
crypto Initialize T1 to silent gcc warning. 2006-10-22 02:19:33 +00:00
ddb Set up the context for the dbbe_trace callback in the ddb. Otherwise, 2006-11-06 11:10:57 +00:00
dev Added PCI ID's for: 2006-11-06 12:19:43 +00:00
fs Create a bidirectional mapping of the DOS 'read only' attribute 2006-11-05 06:38:42 +00:00
gdb Convert to new console api 2006-05-26 13:54:27 +00:00
geom Fix ia64 build breakage. 2006-11-02 16:24:18 +00:00
gnu Add mnt_noasync counter to better handle interleaved calls to nmount(), 2006-09-26 04:15:59 +00:00
i4b Extend i4b to support CAPI manager based ISDN controllers (CAPI manager is part of 2006-07-09 21:16:06 +00:00
i386 Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
ia64 Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
isa Use calendaric calculation support from subr_clock.c instead of home-rolled. 2006-10-02 16:18:40 +00:00
isofs/cd9660 Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag. 2006-09-26 04:12:49 +00:00
kern Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
libkern Add strstr() function to the libkern. 2006-08-12 15:28:39 +00:00
modules Remove no longer existing opt_bdg.h and opt_bge.h. 2006-11-03 21:41:19 +00:00
net Fix possible leak when bridge is in monitor mode. Use m_freem() which will 2006-11-05 17:56:25 +00:00
net80211 Now that we have COMPAT_FREEBSD6 officially, use it from opt_compat.h. 2006-09-26 12:41:13 +00:00
netatalk Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
netatm Change semantics of socket close and detach. Add a new protocol switch 2006-07-21 17:11:15 +00:00
netgraph Rename m_getm() to m_getm2() and rewrite it to allocate up to page sized 2006-11-02 17:37:22 +00:00
netinet Revert previous commit, and instead make the expression in rev. 1.2 2006-11-05 14:36:59 +00:00
netinet6 Tons of fixes to get all the 64bit issues removed. 2006-11-05 13:25:18 +00:00
netipsec Fix build breakage from previous commit which confused key_abort and key_close. 2006-07-22 09:18:02 +00:00
netipx Change semantics of socket close and detach. Add a new protocol switch 2006-07-21 17:11:15 +00:00
netkey With exception of the if_name() macro, all definitions in net_osdep.h 2006-08-04 21:27:40 +00:00
netnatm Change semantics of socket close and detach. Add a new protocol switch 2006-07-21 17:11:15 +00:00
netncp - Fix ncp_poll() to not panic if the socket doesn't have any pending data. 2006-08-03 15:31:52 +00:00
netsmb It seems to be safe to ignore 'file not locked' error 2006-11-05 06:31:08 +00:00
nfs
nfs4client Fixes up the handling of shared vnode lock lookups in the NFS client, 2006-09-13 18:39:09 +00:00
nfsclient Make EWOULDBLOCK a recoverable error so that the request is retransmitted. 2006-10-31 20:25:37 +00:00
nfsserver Fix leak in NAMEI zone caused by nfs server when VOP_RENAME fails. 2006-10-26 12:41:53 +00:00
opencrypto When DIAGNOSTIC is defined, verify if we don't free crypto requests from 2006-06-06 15:04:52 +00:00
pc98 Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
pccard
pci 2nd and final commit that moves us to CAM_NEW_TRAN_CODE 2006-11-02 00:54:38 +00:00
posix4 Make KSE a kernel option, turned on by default in all GENERIC 2006-10-26 21:42:22 +00:00
powerpc Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
rpc
security Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
sparc64 Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
sun4v Remove the KDTRACE option again because of the complaints about having 2006-11-04 23:50:12 +00:00
sys Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
tools Check for errors when registering and unregistering firmware modules. This 2006-06-16 21:06:03 +00:00
ufs Aquire Giant in the softdep_flush for clear_remove() and clear_inodedeps() 2006-11-01 13:48:44 +00:00
vm Make KSE a kernel option, turned on by default in all GENERIC 2006-10-26 21:42:22 +00:00
Makefile Don't need to special case arm here anymore 2006-08-10 06:29:43 +00:00