[RFC PATCH v10 00/20] Labeled networking changes for 2.6.25

2008-01-03 Thread Paul Moore
One more update on the 2.6.25 labeled networking patchset. As usual, these changes can also be found in git form here: * git://git.infradead.org/users/pcmoore/lblnet-2.6_testing This revision fixes a problem with the sk_buff's 'iif' field not being copied during a clone operation. Thanks to

[RFC PATCH v10 02/20] NetLabel: Cleanup the LSM domain hash functions

2008-01-03 Thread Paul Moore
The NetLabel/LSM domain hash table search function used an argument to specify if the default entry should be returned if an exact match couldn't be found in the hash table. This is a bit against the kernel's style so make two separate functions to represent the separate behaviors.

[RFC PATCH v10 03/20] NetLabel: Consolidate the LSM domain mapping/hashing locks

2008-01-03 Thread Paul Moore
Currently we use two separate spinlocks to protect both the hash/mapping table and the default entry. This could be considered a bit foolish because it adds complexity without offering any real performance advantage. This patch removes the dedicated default spinlock and protects the default

[RFC PATCH v10 04/20] NetLabel: Add secid token support to the NetLabel secattr struct

2008-01-03 Thread Paul Moore
This patch adds support to the NetLabel LSM secattr struct for a secid token and a type field, paving the way for full LSM/SELinux context support and static or fallback labels. In addition, this patch adds a fair amount of documentation to the core NetLabel structures used as part of the

[RFC PATCH v10 05/20] LSM: Add secctx_to_secid() LSM hook

2008-01-03 Thread Paul Moore
Add a secctx_to_secid() LSM hook to go along with the existing secid_to_secctx() LSM hook. This patch also includes the SELinux implementation for this hook. Signed-off-by: Paul Moore [EMAIL PROTECTED] Acked-by: Stephen Smalley [EMAIL PROTECTED] --- include/linux/security.h | 13

[RFC PATCH v10 06/20] LSM: Add inet_sys_snd_skb() LSM hook

2008-01-03 Thread Paul Moore
Add an inet_sys_snd_skb() LSM hook to allow the LSM to provide packet level access control for all outbound packets. Using the existing postroute_last netfilter hook turns out to be problematic as it is can be invoked multiple times for a single packet, e.g. individual IPsec transforms, adding

[RFC PATCH v10 07/20] NetLabel: Add IP address family information to the netlbl_skbuff_getattr() function

2008-01-03 Thread Paul Moore
In order to do any sort of IP header inspection of incoming packets we need to know which address family, AF_INET/AF_INET6/etc., it belongs to and since the sk_buff structure does not store this information we need to pass along the address family separate from the packet itself. Signed-off-by:

[RFC PATCH v10 08/20] NET: Clone the sk_buff 'iif' field in __skb_clone()

2008-01-03 Thread Paul Moore
Both NetLabel and SELinux (other LSMs may grow to use it as well) rely on the 'iif' field to determine the receiving network interface of inbound packets. Unfortunately, at present this field is not preserved across a skb clone operation which can lead to garbage values if the cloned skb is sent

[RFC PATCH v10 10/20] SELinux: Only store the network interface's ifindex

2008-01-03 Thread Paul Moore
Instead of storing the packet's network interface name store the ifindex. This allows us to defer the need to lookup the net_device structure until the audit record is generated meaning that in the majority of cases we never need to bother with this at all. Signed-off-by: Paul Moore [EMAIL

[RFC PATCH v10 12/20] SELinux: Add a capabilities bitmap to SELinux policy version 22

2008-01-03 Thread Paul Moore
Add a new policy capabilities bitmap to SELinux policy version 22. This bitmap will enable the security server to query the policy to determine which features it supports. Signed-off-by: Paul Moore [EMAIL PROTECTED] --- security/selinux/Kconfig|2 -

[RFC PATCH v10 13/20] SELinux: Add a new peer class and permissions to the Flask definitions

2008-01-03 Thread Paul Moore
Add additional Flask definitions to support the new peer object class and additional permissions to the netif and node object classes. Signed-off-by: Paul Moore [EMAIL PROTECTED] --- security/selinux/include/av_perm_to_string.h |5 + security/selinux/include/av_permissions.h|5

[RFC PATCH v10 14/20] SELinux: Better integration between peer labeling subsystems

2008-01-03 Thread Paul Moore
Rework the handling of network peer labels so that the different peer labeling subsystems work better together. This includes moving both subsystems to a single peer object class which involves not only changes to the permission checks but an improved method of consolidating multiple packet peer

[RFC PATCH v10 15/20] SELinux: Enable dynamic enable/disable of the network access checks

2008-01-03 Thread Paul Moore
This patch introduces a mechanism for checking when labeled IPsec or SECMARK are in use by keeping introducing a configuration reference counter for each subsystem. In the case of labeled IPsec, whenever a labeled SA or SPD entry is created the labeled IPsec/XFRM reference count is increased and

[RFC PATCH v10 17/20] NetLabel: Introduce static network labels for unlabeled connections

2008-01-03 Thread Paul Moore
Most trusted OSs, with the exception of Linux, have the ability to specify static security labels for unlabeled networks. This patch adds this ability to the NetLabel packet labeling framework. If the NetLabel subsystem is called to determine the security attributes of an incoming packet it

[RFC PATCH v10 16/20] SELinux: Allow NetLabel to directly cache SIDs

2008-01-03 Thread Paul Moore
Now that the SELinux NetLabel base SID is always the netmsg initial SID we can do a big optimization - caching the SID and not just the MLS attributes. This not only saves a lot of per-packet memory allocations and copies but it has a nice side effect of removing a chunk of code. Signed-off-by:

Re: [PATCH] Exporting capability code/name pairs

2008-01-03 Thread KaiGai Kohei
There is also the issue of compiled code which explicitly raises and lowers capabilities around critical code sections (ie., as they were intended to be used) is also not well served by this change. That is, unless the code was compiled with things like CAP_MAC_ADMIN being #define'd then it