1. 07 4月, 2009 1 次提交
  2. 03 4月, 2009 1 次提交
    • S
      don't raise all privs on setuid-root file with fE set (v2) · b5f22a59
      Serge E. Hallyn 提交于
      Distributions face a backward compatibility problem with starting to use
      file capabilities.  For instance, removing setuid root from ping and
      doing setcap cap_net_raw=pe means that booting with an older kernel
      or one compiled without file capabilities means ping won't work for
      non-root users.
      
      In order to replace the setuid root bit on a capability-unaware
      program, one has to set the effective, or legacy, file capability,
      which makes the capability effective immediately.  This patch
      uses the legacy bit as a queue to not automatically add full
      privilege to a setuid-root program.
      
      So, with this patch, an ordinary setuid-root program will run with
      privilege.  But if /bin/ping has both setuid-root and cap_net_raw in
      fP and fE, then ping (when run by non-root user) will not run
      with only cap_net_raw.
      
      Changelog:
      	Apr 2 2009: Print a message once when such a binary is loaded,
      		as per James Morris' suggestion.
      	Apr 2 2009: Fix the condition to only catch uid!=0 && euid==0.
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b5f22a59
  3. 02 4月, 2009 1 次提交
    • K
      Permissive domain in userspace object manager · 8a6f83af
      KaiGai Kohei 提交于
      This patch enables applications to handle permissive domain correctly.
      
      Since the v2.6.26 kernel, SELinux has supported an idea of permissive
      domain which allows certain processes to work as if permissive mode,
      even if the global setting is enforcing mode.
      However, we don't have an application program interface to inform
      what domains are permissive one, and what domains are not.
      It means applications focuses on SELinux (XACE/SELinux, SE-PostgreSQL
      and so on) cannot handle permissive domain correctly.
      
      This patch add the sixth field (flags) on the reply of the /selinux/access
      interface which is used to make an access control decision from userspace.
      If the first bit of the flags field is positive, it means the required
      access control decision is on permissive domain, so application should
      allow any required actions, as the kernel doing.
      
      This patch also has a side benefit. The av_decision.flags is set at
      context_struct_compute_av(). It enables to check required permissions
      without read_lock(&policy_rwlock).
      Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Acked-by: NEric Paris <eparis@redhat.com>
      --
       security/selinux/avc.c              |    2 +-
       security/selinux/include/security.h |    4 +++-
       security/selinux/selinuxfs.c        |    4 ++--
       security/selinux/ss/services.c      |   30 +++++-------------------------
       4 files changed, 11 insertions(+), 29 deletions(-)
      Signed-off-by: NJames Morris <jmorris@namei.org>
      8a6f83af
  4. 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
  5. 27 3月, 2009 1 次提交
  6. 26 3月, 2009 1 次提交
  7. 10 3月, 2009 1 次提交
  8. 06 3月, 2009 2 次提交
  9. 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
  10. 02 3月, 2009 1 次提交
  11. 27 2月, 2009 4 次提交
  12. 23 2月, 2009 3 次提交
  13. 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
  14. 19 2月, 2009 1 次提交
  15. 16 2月, 2009 1 次提交
  16. 14 2月, 2009 10 次提交
  17. 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
  18. 12 2月, 2009 3 次提交