1. 10 4月, 2009 1 次提交
    • D
      keys: Handle there being no fallback destination keyring for request_key() · 34574dd1
      David Howells 提交于
      When request_key() is called, without there being any standard process
      keyrings on which to fall back if a destination keyring is not specified, an
      oops is liable to occur when construct_alloc_key() calls down_write() on
      dest_keyring's semaphore.
      
      Due to function inlining this may be seen as an oops in down_write() as called
      from request_key_and_link().
      
      This situation crops up during boot, where request_key() is called from within
      the kernel (such as in CIFS mounts) where nobody is actually logged in, and so
      PAM has not had a chance to create a session keyring and user keyrings to act
      as the fallback.
      
      To fix this, make construct_alloc_key() not attempt to cache a key if there is
      no fallback key if no destination keyring is given specifically.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Tested-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34574dd1
  2. 09 4月, 2009 1 次提交
  3. 07 4月, 2009 1 次提交
  4. 03 4月, 2009 2 次提交
  5. 01 4月, 2009 1 次提交
  6. 28 3月, 2009 5 次提交
    • E
      smack: Add a new '-CIPSO' option to the network address label configuration · 4303154e
      Etienne Basset 提交于
      This patch adds a new special option '-CIPSO' to the Smack subsystem. When used
      in the netlabel list, it means "use CIPSO networking". A use case is when your
      local network speaks CIPSO and you want also to connect to the unlabeled
      Internet. This patch also add some documentation describing that. The patch
      also corrects an oops when setting a '' SMACK64 xattr to a file.
      Signed-off-by: NEtienne Basset <etienne.basset@numericable.fr>
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      4303154e
    • P
      netlabel: Cleanup the Smack/NetLabel code to fix incoming TCP connections · 07feee8f
      Paul Moore 提交于
      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: NPaul Moore <paul.moore@hp.com>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      07feee8f
    • P
      lsm: Remove the socket_post_accept() hook · 8651d5c0
      Paul Moore 提交于
      The socket_post_accept() hook is not currently used by any in-tree modules
      and its existence continues to cause problems by confusing people about
      what can be safely accomplished using this hook.  If a legitimate need for
      this hook arises in the future it can always be reintroduced.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      8651d5c0
    • P
      selinux: Remove the "compat_net" compatibility code · 58bfbb51
      Paul Moore 提交于
      The SELinux "compat_net" is marked as deprecated, the time has come to
      finally remove it from the kernel.  Further code simplifications are
      likely in the future, but this patch was intended to be a simple,
      straight-up removal of the compat_net code.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      58bfbb51
    • P
      netlabel: Label incoming TCP connections correctly in SELinux · 389fb800
      Paul Moore 提交于
      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: NPaul Moore <paul.moore@hp.com>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      389fb800
  7. 27 3月, 2009 1 次提交
  8. 26 3月, 2009 1 次提交
  9. 10 3月, 2009 1 次提交
  10. 06 3月, 2009 2 次提交
  11. 05 3月, 2009 2 次提交
    • E
      smack: fixes for unlabeled host support · 211a40c0
      etienne 提交于
      The following patch (against 2.6.29rc5) fixes a few issues in the
      smack/netlabel "unlabeled host support" functionnality that was added in
      2.6.29rc.  It should go in before -final.
      
      1) smack_host_label disregard a "0.0.0.0/0 @" rule (or other label),
      preventing 'tagged' tasks to access Internet (many systems drop packets with
      IP options)
      
      2) netmasks were not handled correctly, they were stored in a way _not
      equivalent_ to conversion to be32 (it was equivalent for /0, /8, /16, /24,
      /32 masks but not other masks)
      
      3) smack_netlbladdr prefixes (IP/mask) were not consistent (mask&IP was not
      done), so there could have been different list entries for the same IP
      prefix; if those entries had different labels, well ...
      
      4) they were not sorted
      
      1) 2) 3) are bugs, 4) is a more cosmetic issue.
      The patch :
      
      -creates a new helper smk_netlbladdr_insert to insert a smk_netlbladdr,
      -sorted by netmask length
      
      -use the new sorted nature of  smack_netlbladdrs list to simplify
       smack_host_label : the first match _will_ be the more specific
      
      -corrects endianness issues in smk_write_netlbladdr &  netlbladdr_seq_show
      
      Signed-off-by: <etienne.basset@numericable.fr>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Reviewed-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      211a40c0
    • E
      smack: fixes for unlabeled host support · 113a0e45
      etienne 提交于
      The following patch (against 2.6.29rc5) fixes a few issues in the
      smack/netlabel "unlabeled host support" functionnality that was added in
      2.6.29rc.  It should go in before -final.
      
      1) smack_host_label disregard a "0.0.0.0/0 @" rule (or other label),
      preventing 'tagged' tasks to access Internet (many systems drop packets with
      IP options)
      
      2) netmasks were not handled correctly, they were stored in a way _not
      equivalent_ to conversion to be32 (it was equivalent for /0, /8, /16, /24,
      /32 masks but not other masks)
      
      3) smack_netlbladdr prefixes (IP/mask) were not consistent (mask&IP was not
      done), so there could have been different list entries for the same IP
      prefix; if those entries had different labels, well ...
      
      4) they were not sorted
      
      1) 2) 3) are bugs, 4) is a more cosmetic issue.
      The patch :
      
      -creates a new helper smk_netlbladdr_insert to insert a smk_netlbladdr,
      -sorted by netmask length
      
      -use the new sorted nature of  smack_netlbladdrs list to simplify
       smack_host_label : the first match _will_ be the more specific
      
      -corrects endianness issues in smk_write_netlbladdr &  netlbladdr_seq_show
      
      Signed-off-by: <etienne.basset@numericable.fr>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Reviewed-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      113a0e45
  12. 02 3月, 2009 1 次提交
  13. 27 2月, 2009 4 次提交
  14. 23 2月, 2009 3 次提交
  15. 20 2月, 2009 1 次提交
    • M
      integrity: ima scatterlist bug fix · 0da0a420
      Mimi Zohar 提交于
      Based on Alexander Beregalov's post http://lkml.org/lkml/2009/2/19/198
      
      - replaced sg_set_buf() with sg_init_one()
      
       kernel BUG at include/linux/scatterlist.h:65!
       invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
       last sysfs file:
       CPU 2
       Modules linked in:
       Pid: 1, comm: swapper Not tainted 2.6.29-rc5-next-20090219 #5 PowerEdge 1950
       RIP: 0010:[<ffffffff8045ec70>]  [<ffffffff8045ec70>] ima_calc_hash+0xc0/0x160
       RSP: 0018:ffff88007f46bc40  EFLAGS: 00010286
       RAX: ffffe200032c45e8 RBX: 00000000fffffff4 RCX: 0000000087654321
       RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff88007cf71048
       RBP: ffff88007f46bcd0 R08: 0000000000000000 R09: 0000000000000163
       R10: ffff88007f4707a8 R11: 0000000000000000 R12: ffff88007cf71048
       R13: 0000000000001000 R14: 0000000000000000 R15: 0000000000009d98
       FS:  0000000000000000(0000) GS:ffff8800051ac000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
       CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006e0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Tested-by: NAlexander Beregalov <a.beregalov@gmail.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      0da0a420
  16. 19 2月, 2009 1 次提交
  17. 16 2月, 2009 1 次提交
  18. 14 2月, 2009 10 次提交
  19. 13 2月, 2009 1 次提交
    • R
      ima: fix build error · b53fab9d
      Randy Dunlap 提交于
      IMA_LSM_RULES requires AUDIT.  This is automatic if SECURITY_SELINUX=y
      but not when SECURITY_SMACK=y (and SECURITY_SELINUX=n), so make the
      dependency explicit.  This fixes the following build error:
      
      security/integrity/ima/ima_policy.c:111:error: implicit declaration of function 'security_audit_rule_match'
      security/integrity/ima/ima_policy.c:230:error: implicit declaration of function 'security_audit_rule_init'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b53fab9d