1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00
freebsd/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
cam Remove extra whitespace 2006-11-03 05:42:15 +00:00
coda
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
geom Fix ia64 build breakage. 2006-11-02 16:24:18 +00:00
gnu
i4b
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
isofs/cd9660
kern Add a new priv(9) kernel interface for checking the availability of 2006-11-06 13:37:19 +00:00
libkern
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
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
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
netipx
netkey
netnatm
netncp
netsmb It seems to be safe to ignore 'file not locked' error 2006-11-05 06:31:08 +00:00
nfs
nfs4client
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
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
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