1. 30 1月, 2008 7 次提交
    • P
      NetLabel: Introduce static network labels for unlabeled connections · 8cc44579
      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 checks to see if any recognized NetLabel packet
      labeling protocols are in-use on the packet.  If none can be found then the
      unlabled connection table is queried and based on the packets incoming
      interface and address it is matched with a security label as configured by the
      administrator using the netlabel_tools package.  The matching security label is
      returned to the caller just as if the packet was explicitly labeled using a
      labeling protocol.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      8cc44579
    • P
      SELinux: Enable dynamic enable/disable of the network access checks · d621d35e
      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 when the
      entry is removed it is decreased.  In the case of SECMARK, when a SECMARK
      target is created the reference count is increased and later decreased when the
      target is removed.  These reference counters allow SELinux to quickly determine
      if either of these subsystems are enabled.
      
      NetLabel already has a similar mechanism which provides the netlbl_enabled()
      function.
      
      This patch also renames the selinux_relabel_packet_permission() function to
      selinux_secmark_relabel_packet_permission() as the original name and
      description were misleading in that they referenced a single packet label which
      is not the case.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      d621d35e
    • P
      NetLabel: Add IP address family information to the netlbl_skbuff_getattr() function · 75e22910
      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: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      75e22910
    • P
      NetLabel: Add secid token support to the NetLabel secattr struct · 16efd454
      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
      NetLabel kernel API.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      16efd454
    • P
      NetLabel: Consolidate the LSM domain mapping/hashing locks · 1c3fad93
      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 with the
      hash/mapping table spinlock.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      1c3fad93
    • P
      NetLabel: Cleanup the LSM domain hash functions · b64397e0
      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: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b64397e0
    • P
      NetLabel: Remove unneeded RCU read locks · c783f1ce
      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: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      c783f1ce
  2. 29 1月, 2008 33 次提交