freebsd-nq/sys/security
Robert Watson a557af222b Introduce a MAC label reference in 'struct inpcb', which caches
the   MAC label referenced from 'struct socket' in the IPv4 and
IPv6-based protocols.  This permits MAC labels to be checked during
network delivery operations without dereferencing inp->inp_socket
to get to so->so_label, which will eventually avoid our having to
grab the socket lock during delivery at the network layer.

This change introduces 'struct inpcb' as a labeled object to the
MAC Framework, along with the normal circus of entry points:
initialization, creation from socket, destruction, as well as a
delivery access control check.

For most policies, the inpcb label will simply be a cache of the
socket label, so a new protocol switch method is introduced,
pr_sosetlabel() to notify protocols that the socket layer label
has been updated so that the cache can be updated while holding
appropriate locks.  Most protocols implement this using
pru_sosetlabel_null(), but IPv4/IPv6 protocols using inpcbs use
the the worker function in_pcbsosetlabel(), which calls into the
MAC Framework to perform a cache update.

Biba, LOMAC, and MLS implement these entry points, as do the stub
policy, and test policy.

Reviewed by:	sam, bms
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-11-18 00:39:07 +00:00
..
mac Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_biba Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_bsdextended Implementations of mpo_check_vnode_deleteextattr() and 2003-08-21 14:34:54 +00:00
mac_ifoff Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_lomac Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_mls Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_none mac_none is now the null policy, not a stub policy, so remove the 2003-08-21 16:19:17 +00:00
mac_partition Modify the MAC Framework so that instead of embedding a (struct label) 2003-11-12 03:14:31 +00:00
mac_portacl Including <sys/stdint.h> is (almost?) universally only to be able to use 2003-03-18 08:45:25 +00:00
mac_seeotheruids Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_stub Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
mac_test Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00