<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/security/mac/mac_inet.c, branch release/8.1.0_cvs</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F8.1.0_cvs</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F8.1.0_cvs'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2010-07-17T05:41:01Z</updated>
<entry>
<title>Copy releng/8.1 to release/8.1.0 for 8.1-RELEASE.</title>
<updated>2010-07-17T05:41:01Z</updated>
<author>
<name>Ken Smith</name>
<email>kensmith@FreeBSD.org</email>
</author>
<published>2010-07-17T05:41:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=90d6fa76a8141fc596ad376ecd86a8a493836298'/>
<id>urn:sha1:90d6fa76a8141fc596ad376ecd86a8a493836298</id>
<content type='text'>
Approved by:	re (implicit)

This commit was manufactured to restore the state of the 8.1-RELEASE image.
</content>
</entry>
<entry>
<title>Continue work to optimize performance of "options MAC" when no MAC policy</title>
<updated>2009-06-03T18:46:28Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-06-03T18:46:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=3de4046939a04576ede9d97f48f6a02d1a2ccc8c'/>
<id>urn:sha1:3de4046939a04576ede9d97f48f6a02d1a2ccc8c</id>
<content type='text'>
modules are loaded by avoiding mbuf label lookups when policies aren't
loaded, pushing further socket locking into MAC policy modules, and
avoiding locking MAC ifnet locks when no policies are loaded:

- Check mac_policies_count before looking for mbuf MAC label m_tags in MAC
  Framework entry points.  We will still pay label lookup costs if MAC
  policies are present but don't require labels (typically a single mbuf
  header field read, but perhaps further indirection if IPSEC or other
  m_tag consumers are in use).

- Further push socket locking for socket-related access control checks and
  events into MAC policies from the MAC Framework, so that sockets are
  only locked if a policy specifically requires a lock to protect a label.
  This resolves lock order issues during sonewconn() and also in local
  domain socket cross-connect where multiple socket locks could not be
  held at once for the purposes of propagatig MAC labels across multiple
  sockets.  Eliminate mac_policy_count check in some entry points where it
  no longer avoids locking.

- Add mac_policy_count checking in some entry points relating to network
  interfaces that otherwise lock a global MAC ifnet lock used to protect
  ifnet labels.

Obtained from:	TrustedBSD Project
</content>
</entry>
<entry>
<title>Rename MAC Framework-internal macros used to invoke policy entry points:</title>
<updated>2009-05-01T21:05:40Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-05-01T21:05:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=fa76567150773e0aab5fdd883cf7652a27c7c25e'/>
<id>urn:sha1:fa76567150773e0aab5fdd883cf7652a27c7c25e</id>
<content type='text'>
  MAC_BOOLEAN           -&gt; MAC_POLICY_BOOLEAN
  MAC_BOOLEAN_NOSLEEP   -&gt; MAC_POLICY_BOOLEANN_NOSLEEP
  MAC_CHECK             -&gt; MAC_POLICY_CHECK
  MAC_CHECK_NOSLEEP     -&gt; MAC_POLICY_CHECK_NOSLEEP
  MAC_EXTERNALIZE       -&gt; MAC_POLICY_EXTERNALIZE
  MAC_GRANT             -&gt; MAC_POLICY_GRANT
  MAC_GRANT_NOSLEEP     -&gt; MAC_POLICY_GRANT_NOSLEEP
  MAC_INTERNALIZE       -&gt; MAC_POLICY_INTERNALIZE
  MAC_PERFORM           -&gt; MAC_POLICY_PERFORM_CHECK
  MAC_PERFORM_NOSLEEP   -&gt; MAC_POLICY_PERFORM_NOSLEEP

This frees up those macro names for use in wrapping calls into the MAC
Framework from the remainder of the kernel.

Obtained from:	TrustedBSD Project
</content>
</entry>
<entry>
<title>Rework MAC Framework synchronization in a number of ways in order to</title>
<updated>2009-03-14T16:06:06Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-03-14T16:06:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=4020272933cbe552f932d9642419f8becee04bd5'/>
<id>urn:sha1:4020272933cbe552f932d9642419f8becee04bd5</id>
<content type='text'>
improve performance:

- Eliminate custom reference count and condition variable to monitor
  threads entering the framework, as this had both significant overhead
  and behaved badly in the face of contention.

- Replace reference count with two locks: an rwlock and an sx lock,
  which will be read-acquired by threads entering the framework
  depending on whether a give policy entry point is permitted to sleep
  or not.

- Replace previous mutex locking of the reference count for exclusive
  access with write acquiring of both the policy list sx and rw locks,
  which occurs only when policies are attached or detached.

- Do a lockless read of the dynamic policy list head before acquiring
  any locks in order to reduce overhead when no dynamic policies are
  loaded; this a race we can afford to lose.

- For every policy entry point invocation, decide whether sleeping is
  permitted, and if not, use a _NOSLEEP() variant of the composition
  macros, which will use the rwlock instead of the sxlock.  In some
  cases, we decide which to use based on allocation flags passed to the
  MAC Framework entry point.

As with the move to rwlocks/rmlocks in pfil, this may trigger witness
warnings, but these should (generally) be false positives as all
acquisition of the locks is for read with two very narrow exceptions
for policy load/unload, and those code blocks should never acquire
other locks.

Sponsored by:	Google, Inc.
Obtained from:	TrustedBSD Project
Discussed with:	csjp (idea, not specific patch)
</content>
</entry>
<entry>
<title>Add static DTrace probes for MAC Framework access control checks and</title>
<updated>2009-03-08T00:50:37Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-03-08T00:50:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=2087a58ca2406238cd7068bee7be3ea1065786df'/>
<id>urn:sha1:2087a58ca2406238cd7068bee7be3ea1065786df</id>
<content type='text'>
privilege grants so that dtrace can be more easily used to monitor
the security decisions being generated by the MAC Framework following
policy invocation.

Successful access control checks will be reported by:

  mac_framework:kernel:&lt;entrypoint&gt;:mac_check_ok

Failed access control checks will be reported by:

  mac_framework:kernel:&lt;entrypoint&gt;:mac_check_err

Successful privilege grants will be reported by:

  mac_framework:kernel:priv_grant:mac_grant_ok

Failed privilege grants will be reported by:

  mac_framework:kernel:priv_grant:mac_grant_err

In all cases, the return value (always 0 for _ok, otherwise an errno
for _err) will be reported via arg0 on the probe, and subsequent
arguments will hold entrypoint-specific data, in a style similar to
privilege tracing.

Obtained from:	TrustedBSD Project
Sponsored by:	Google, Inc.
</content>
</entry>
<entry>
<title>Add mac_inpcb_check_visible MAC Framework entry point, which is similar</title>
<updated>2008-10-17T12:54:28Z</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2008-10-17T12:54:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=37ee72936b6d56df729f04d3384410373250b5f9'/>
<id>urn:sha1:37ee72936b6d56df729f04d3384410373250b5f9</id>
<content type='text'>
to mac_socket_check_visible but operates on the inpcb.

Reviewed by:	rwatson
MFC after:	3 months (set timer, decide then)
</content>
</entry>
<entry>
<title>Introduce two related changes to the TrustedBSD MAC Framework:</title>
<updated>2008-08-23T15:26:36Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-08-23T15:26:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=6356dba0b403daa023dec24559ab1f8e602e4f14'/>
<id>urn:sha1:6356dba0b403daa023dec24559ab1f8e602e4f14</id>
<content type='text'>
(1) Abstract interpreter vnode labeling in execve(2) and mac_execve(2)
    so that the general exec code isn't aware of the details of
    allocating, copying, and freeing labels, rather, simply passes in
    a void pointer to start and stop functions that will be used by
    the framework.  This change will be MFC'd.

(2) Introduce a new flags field to the MAC_POLICY_SET(9) interface
    allowing policies to declare which types of objects require label
    allocation, initialization, and destruction, and define a set of
    flags covering various supported object types (MPC_OBJECT_PROC,
    MPC_OBJECT_VNODE, MPC_OBJECT_INPCB, ...).  This change reduces the
    overhead of compiling the MAC Framework into the kernel if policies
    aren't loaded, or if policies require labels on only a small number
    or even no object types.  Each time a policy is loaded or unloaded,
    we recalculate a mask of labeled object types across all policies
    present in the system.  Eliminate MAC_ALWAYS_LABEL_MBUF option as it
    is no longer required.

MFC after:	1 week ((1) only)
Reviewed by:	csjp
Obtained from:	TrustedBSD Project
Sponsored by:	Apple, Inc.
</content>
</entry>
<entry>
<title>The TrustedBSD MAC Framework named struct ipq instances 'ipq', which is the</title>
<updated>2008-06-13T22:14:15Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-06-13T22:14:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=37f44cb4289f68504f5ac2097eb5d8d4d31c4390'/>
<id>urn:sha1:37f44cb4289f68504f5ac2097eb5d8d4d31c4390</id>
<content type='text'>
same as the global variable defined in ip_input.c.  Instead, adopt the name
'q' as found in about 1/2 of uses in ip_input.c, preventing a collision on
the name.  This is non-harmful, but means that search and replace on the
global works less well (as in the virtualization work), as well as indexing
tools.

MFC after:	1 week
Reported by:	julian
</content>
</entry>
<entry>
<title>Plug a memory leak which can occur when multiple MAC policies are loaded</title>
<updated>2008-05-27T14:18:02Z</updated>
<author>
<name>Christian S.J. Peron</name>
<email>csjp@FreeBSD.org</email>
</author>
<published>2008-05-27T14:18:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=1f84ab0f2a69103cc9453c9c4c2d225f14c67707'/>
<id>urn:sha1:1f84ab0f2a69103cc9453c9c4c2d225f14c67707</id>
<content type='text'>
which label mbufs.  This leak can occur if one policy successfully allocates
label storage and subsequent allocations from other policies fail.

Spotted by:	rwatson
MFC after:	1 week
</content>
</entry>
<entry>
<title>When propagating a MAC label from an inpcb to an mbuf, allow read and</title>
<updated>2008-04-19T18:35:27Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-04-19T18:35:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=211b72ad2f0fe17b59a0477765b56290109da309'/>
<id>urn:sha1:211b72ad2f0fe17b59a0477765b56290109da309</id>
<content type='text'>
write locks on the inpcb, not just write locks.

MFC after:	3 months
</content>
</entry>
</feed>
