<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/netlabel.h, branch v3.0.62</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/include/net/netlabel.h?h=v3.0.62</id>
<link rel='self' href='https://git.amat.us/linux/atom/include/net/netlabel.h?h=v3.0.62'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-03-30T13:02:32Z</updated>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>urn:sha1:5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
</entry>
<entry>
<title>netlabel: Cleanup the Smack/NetLabel code to fix incoming TCP connections</title>
<updated>2009-03-28T04:01:37Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2009-03-27T21:10:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=07feee8f812f7327a46186f7604df312c8c81962'/>
<id>urn:sha1:07feee8f812f7327a46186f7604df312c8c81962</id>
<content type='text'>
This patch cleans up a lot of the Smack network access control code.  The
largest changes are to fix the labeling of incoming TCP connections in a
manner similar to the recent SELinux changes which use the
security_inet_conn_request() hook to label the request_sock and let the label
move to the child socket via the normal network stack mechanisms.  In addition
to the incoming TCP connection fixes this patch also removes the smk_labled
field from the socket_smack struct as the minor optimization advantage was
outweighed by the difficulty in maintaining it's proper state.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Acked-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>netlabel: Label incoming TCP connections correctly in SELinux</title>
<updated>2009-03-28T04:01:36Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2009-03-27T21:10:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=389fb800ac8be2832efedd19978a2b8ced37eb61'/>
<id>urn:sha1:389fb800ac8be2832efedd19978a2b8ced37eb61</id>
<content type='text'>
The current NetLabel/SELinux behavior for incoming TCP connections works but
only through a series of happy coincidences that rely on the limited nature of
standard CIPSO (only able to convey MLS attributes) and the write equality
imposed by the SELinux MLS constraints.  The problem is that network sockets
created as the result of an incoming TCP connection were not on-the-wire
labeled based on the security attributes of the parent socket but rather based
on the wire label of the remote peer.  The issue had to do with how IP options
were managed as part of the network stack and where the LSM hooks were in
relation to the code which set the IP options on these newly created child
sockets.  While NetLabel/SELinux did correctly set the socket's on-the-wire
label it was promptly cleared by the network stack and reset based on the IP
options of the remote peer.

This patch, in conjunction with a prior patch that adjusted the LSM hook
locations, works to set the correct on-the-wire label format for new incoming
connections through the security_inet_conn_request() hook.  Besides the
correct behavior there are many advantages to this change, the most significant
is that all of the NetLabel socket labeling code in SELinux now lives in hooks
which can return error codes to the core stack which allows us to finally get
ride of the selinux_netlbl_inode_permission() logic which greatly simplfies
the NetLabel/SELinux glue code.  In the process of developing this patch I
also ran into a small handful of AF_INET6 cleanliness issues that have been
fixed which should make the code safer and easier to extend in the future.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Acked-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>netlabel: Update kernel configuration API</title>
<updated>2008-12-31T17:54:11Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-12-31T17:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6c2e8ac0953fccdd24dc6c4b9e08e8f1cd68cf07'/>
<id>urn:sha1:6c2e8ac0953fccdd24dc6c4b9e08e8f1cd68cf07</id>
<content type='text'>
Update the NetLabel kernel API to expose the new features added in kernel
releases 2.6.25 and 2.6.28: the static/fallback label functionality and network
address based selectors.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
</content>
</entry>
<entry>
<title>netlabel: Add configuration support for local labeling</title>
<updated>2008-10-10T14:16:34Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d91d40799165b0c84c97e7c71fb8039494ff07dc'/>
<id>urn:sha1:d91d40799165b0c84c97e7c71fb8039494ff07dc</id>
<content type='text'>
Add the necessary NetLabel support for the new CIPSO mapping,
CIPSO_V4_MAP_LOCAL, which allows full LSM label/context support.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>netlabel: Changes to the NetLabel security attributes to allow LSMs to pass full contexts</title>
<updated>2008-10-10T14:16:33Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d75899d033617316e06296b7c0729612f56aba0'/>
<id>urn:sha1:8d75899d033617316e06296b7c0729612f56aba0</id>
<content type='text'>
This patch provides support for including the LSM's secid in addition to
the LSM's MLS information in the NetLabel security attributes structure.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: Set socket NetLabel based on connection endpoint</title>
<updated>2008-10-10T14:16:33Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=014ab19a69c325f52d7bae54ceeda73d6307ae0c'/>
<id>urn:sha1:014ab19a69c325f52d7bae54ceeda73d6307ae0c</id>
<content type='text'>
Previous work enabled the use of address based NetLabel selectors, which while
highly useful, brought the potential for additional per-packet overhead when
used.  This patch attempts to solve that by applying NetLabel socket labels
when sockets are connect()'d.  This should alleviate the per-packet NetLabel
labeling for all connected sockets (yes, it even works for connected DGRAM
sockets).

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>netlabel: Add functionality to set the security attributes of a packet</title>
<updated>2008-10-10T14:16:32Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=948bf85c1bc9a84754786a9d5dd99b7ecc46451e'/>
<id>urn:sha1:948bf85c1bc9a84754786a9d5dd99b7ecc46451e</id>
<content type='text'>
This patch builds upon the new NetLabel address selector functionality by
providing the NetLabel KAPI and CIPSO engine support needed to enable the
new packet-based labeling.  The only new addition to the NetLabel KAPI at
this point is shown below:

 * int netlbl_skbuff_setattr(skb, family, secattr)

... and is designed to be called from a Netfilter hook after the packet's
IP header has been populated such as in the FORWARD or LOCAL_OUT hooks.

This patch also provides the necessary SELinux hooks to support this new
functionality.  Smack support is not currently included due to uncertainty
regarding the permissions needed to expand the Smack network access controls.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>netlabel: Add network address selectors to the NetLabel/LSM domain mapping</title>
<updated>2008-10-10T14:16:32Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=63c41688743760631188cf0f4ae986a6793ccb0a'/>
<id>urn:sha1:63c41688743760631188cf0f4ae986a6793ccb0a</id>
<content type='text'>
This patch extends the NetLabel traffic labeling capabilities to individual
packets based not only on the LSM domain but the by the destination address
as well.  The changes here only affect the core NetLabel infrastructre,
changes to the NetLabel KAPI and individial protocol engines are also
required but are split out into a different patch to ease review.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>selinux: Fix missing calls to netlbl_skbuff_err()</title>
<updated>2008-10-10T14:16:31Z</updated>
<author>
<name>Paul Moore</name>
<email>paul.moore@hp.com</email>
</author>
<published>2008-10-10T14:16:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dfaebe9825ff34983778f287101bc5f3bce00640'/>
<id>urn:sha1:dfaebe9825ff34983778f287101bc5f3bce00640</id>
<content type='text'>
At some point I think I messed up and dropped the calls to netlbl_skbuff_err()
which are necessary for CIPSO to send error notifications to remote systems.
This patch re-introduces the error handling calls into the SELinux code.

Signed-off-by: Paul Moore &lt;paul.moore@hp.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
</feed>
