Re: [PATCH] Exporting capability code/name pairs

2008-01-03 Thread KaiGai Kohei
James Morris wrote: > On Wed, 2 Jan 2008, KaiGai Kohei wrote: > >>> Another issue is that securityfs depends on CONFIG_SECURITY, which might be >>> undesirable, given that capabilities are a standard feature. >> We can implement this feature on another pseudo filesystems. >> Do you think what file

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 th

[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:

[RFC PATCH v10 19/20] SELinux: Add network ingress and egress control permission checks

2008-01-03 Thread Paul Moore
This patch implements packet ingress/egress controls for SELinux which allow SELinux security policy to control the flow of all IPv4 and IPv6 packets into and out of the system. Currently SELinux does not have proper control over forwarded packets and this patch corrects this problem. Special tha

[RFC PATCH v10 20/20] SELinux: Add warning messages on network denial due to error

2008-01-03 Thread Paul Moore
Currently network traffic can be sliently dropped due to non-avc errors which can lead to much confusion when trying to debug the problem. This patch adds warning messages so that when these events occur there is a user visible notification. Signed-off-by: Paul Moore <[EMAIL PROTECTED]> --- sec

[RFC PATCH v10 18/20] NetLabel: Add auditing to the static labeling mechanism

2008-01-03 Thread Paul Moore
This patch adds auditing support to the NetLabel static labeling mechanism. Signed-off-by: Paul Moore <[EMAIL PROTECTED]> --- include/linux/audit.h |2 net/netlabel/netlabel_unlabeled.c | 207 ++--- 2 files changed, 195 insertions(+), 14 deletion

[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 first

[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 w

[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|

[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 11/20] SELinux: Add a network node caching mechanism similar to the sel_netif_*() functions

2008-01-03 Thread Paul Moore
This patch adds a SELinux IP address/node SID caching mechanism similar to the sel_netif_*() functions. The node SID queries in the SELinux hooks files are also modified to take advantage of this new functionality. In addition, remove the address length information from the sk_buff parsing routin

[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 - security/selinux/include/se

[RFC PATCH v10 09/20] SELinux: Convert the netif code to use ifindex values

2008-01-03 Thread Paul Moore
The current SELinux netif code requires the caller have a valid net_device struct pointer to lookup network interface information. However, we don't always have a valid net_device pointer so convert the netif code to use the ifindex values we always have as part of the sk_buff. This patch also re

[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 PROTE

[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: Pa

[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 ba

[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 unw

[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 NetL

[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. Signed-off-by:

[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 entry

[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 V

[RFC PATCH v10 01/20] NetLabel: Remove unneeded RCU read locks

2008-01-03 Thread Paul Moore
This patch removes some unneeded RCU read locks as we can treat the reads as "safe" even without RCU. It also converts the NetLabel configuration refcount from a spinlock protected u32 into atomic_t to be more consistent with the rest of the kernel. Signed-off-by: Paul Moore <[EMAIL PROTECTED]> -