1. 26 7月, 2013 1 次提交
  2. 21 9月, 2012 1 次提交
  3. 10 4月, 2012 4 次提交
    • W
      SELinux: avc: remove the useless fields in avc_add_callback · 562c99f2
      Wanlong Gao 提交于
      avc_add_callback now just used for registering reset functions
      in initcalls, and the callback functions just did reset operations.
      So, reducing the arguments to only one event is enough now.
      Signed-off-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      562c99f2
    • E
      SELinux: possible NULL deref in context_struct_to_string · bb7081ab
      Eric Paris 提交于
      It's possible that the caller passed a NULL for scontext.  However if this
      is a defered mapping we might still attempt to call *scontext=kstrdup().
      This is bad.  Instead just return the len.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      bb7081ab
    • E
      SELinux: add default_type statements · eed7795d
      Eric Paris 提交于
      Because Fedora shipped userspace based on my development tree we now
      have policy version 27 in the wild defining only default user, role, and
      range.  Thus to add default_type we need a policy.28.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      eed7795d
    • E
      SELinux: allow default source/target selectors for user/role/range · aa893269
      Eric Paris 提交于
      When new objects are created we have great and flexible rules to
      determine the type of the new object.  We aren't quite as flexible or
      mature when it comes to determining the user, role, and range.  This
      patch adds a new ability to specify the place a new objects user, role,
      and range should come from.  For users and roles it can come from either
      the source or the target of the operation.  aka for files the user can
      either come from the source (the running process and todays default) or
      it can come from the target (aka the parent directory of the new file)
      
      examples always are done with
      directory context: system_u:object_r:mnt_t:s0-s0:c0.c512
      process context: unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
      
      [no rule]
      	unconfined_u:object_r:mnt_t:s0   test_none
      [default user source]
      	unconfined_u:object_r:mnt_t:s0   test_user_source
      [default user target]
      	system_u:object_r:mnt_t:s0       test_user_target
      [default role source]
      	unconfined_u:unconfined_r:mnt_t:s0 test_role_source
      [default role target]
      	unconfined_u:object_r:mnt_t:s0   test_role_target
      [default range source low]
      	unconfined_u:object_r:mnt_t:s0 test_range_source_low
      [default range source high]
      	unconfined_u:object_r:mnt_t:s0:c0.c1023 test_range_source_high
      [default range source low-high]
      	unconfined_u:object_r:mnt_t:s0-s0:c0.c1023 test_range_source_low-high
      [default range target low]
      	unconfined_u:object_r:mnt_t:s0 test_range_target_low
      [default range target high]
      	unconfined_u:object_r:mnt_t:s0:c0.c512 test_range_target_high
      [default range target low-high]
      	unconfined_u:object_r:mnt_t:s0-s0:c0.c512 test_range_target_low-high
      Signed-off-by: NEric Paris <eparis@redhat.com>
      aa893269
  4. 06 1月, 2012 2 次提交
  5. 10 9月, 2011 2 次提交
  6. 02 8月, 2011 2 次提交
  7. 27 5月, 2011 1 次提交
    • L
      selinux: don't pass in NULL avd to avc_has_perm_noaudit · f01e1af4
      Linus Torvalds 提交于
      Right now security_get_user_sids() will pass in a NULL avd pointer to
      avc_has_perm_noaudit(), which then forces that function to have a dummy
      entry for that case and just generally test it.
      
      Don't do it.  The normal callers all pass a real avd pointer, and this
      helper function is incredibly hot.  So don't make avc_has_perm_noaudit()
      do conditional stuff that isn't needed for the common case.
      
      This also avoids some duplicated stack space.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f01e1af4
  8. 29 4月, 2011 4 次提交
  9. 25 4月, 2011 1 次提交
  10. 08 4月, 2011 1 次提交
  11. 02 4月, 2011 1 次提交
  12. 31 3月, 2011 1 次提交
  13. 29 3月, 2011 2 次提交
  14. 04 3月, 2011 1 次提交
  15. 02 2月, 2011 1 次提交
    • E
      SELinux: Use dentry name in new object labeling · 652bb9b0
      Eric Paris 提交于
      Currently SELinux has rules which label new objects according to 3 criteria.
      The label of the process creating the object, the label of the parent
      directory, and the type of object (reg, dir, char, block, etc.)  This patch
      adds a 4th criteria, the dentry name, thus we can distinguish between
      creating a file in an etc_t directory called shadow and one called motd.
      
      There is no file globbing, regex parsing, or anything mystical.  Either the
      policy exactly (strcmp) matches the dentry name of the object or it doesn't.
      This patch has no changes from today if policy does not implement the new
      rules.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      652bb9b0
  16. 01 12月, 2010 4 次提交
  17. 21 10月, 2010 5 次提交
    • S
      selinux: include vmalloc.h for vmalloc_user · f0d3d989
      Stephen Rothwell 提交于
      Include vmalloc.h for vmalloc_user (fixes ppc build warning).
      Acked-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f0d3d989
    • E
      selinux: implement mmap on /selinux/policy · 845ca30f
      Eric Paris 提交于
      /selinux/policy allows a user to copy the policy back out of the kernel.
      This patch allows userspace to actually mmap that file and use it directly.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      845ca30f
    • E
      SELinux: allow userspace to read policy back out of the kernel · cee74f47
      Eric Paris 提交于
      There is interest in being able to see what the actual policy is that was
      loaded into the kernel.  The patch creates a new selinuxfs file
      /selinux/policy which can be read by userspace.  The actual policy that is
      loaded into the kernel will be written back out to userspace.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      cee74f47
    • E
      security: secid_to_secctx returns len when data is NULL · d5630b9d
      Eric Paris 提交于
      With the (long ago) interface change to have the secid_to_secctx functions
      do the string allocation instead of having the caller do the allocation we
      lost the ability to query the security server for the length of the
      upcoming string.  The SECMARK code would like to allocate a netlink skb
      with enough length to hold the string but it is just too unclean to do the
      string allocation twice or to do the allocation the first time and hold
      onto the string and slen.  This patch adds the ability to call
      security_secid_to_secctx() with a NULL data pointer and it will just set
      the slen pointer.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Reviewed-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      d5630b9d
    • K
      selinux: fast status update interface (/selinux/status) · 11904167
      KaiGai Kohei 提交于
      This patch provides a new /selinux/status entry which allows applications
      read-only mmap(2).
      This region reflects selinux_kernel_status structure in kernel space.
        struct selinux_kernel_status
        {
                u32     length;         /* length of this structure */
                u32     sequence;       /* sequence number of seqlock logic */
                u32     enforcing;      /* current setting of enforcing mode */
                u32     policyload;     /* times of policy reloaded */
                u32     deny_unknown;   /* current setting of deny_unknown */
        };
      
      When userspace object manager caches access control decisions provided
      by SELinux, it needs to invalidate the cache on policy reload and setenforce
      to keep consistency.
      However, the applications need to check the kernel state for each accesses
      on userspace avc, or launch a background worker process.
      In heuristic, frequency of invalidation is much less than frequency of
      making access control decision, so it is annoying to invoke a system call
      to check we don't need to invalidate the userspace cache.
      If we can use a background worker thread, it allows to receive invalidation
      messages from the kernel. But it requires us an invasive coding toward the
      base application in some cases; E.g, when we provide a feature performing
      with SELinux as a plugin module, it is unwelcome manner to launch its own
      worker thread from the module.
      
      If we could map /selinux/status to process memory space, application can
      know updates of selinux status; policy reload or setenforce.
      
      A typical application checks selinux_kernel_status::sequence when it tries
      to reference userspace avc. If it was changed from the last time when it
      checked userspace avc, it means something was updated in the kernel space.
      Then, the application can reset userspace avc or update current enforcing
      mode, without any system call invocations.
      This sequence number is updated according to the seqlock logic, so we need
      to wait for a while if it is odd number.
      Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
      Acked-by: NEric Paris <eparis@redhat.com>
      --
       security/selinux/include/security.h |   21 ++++++
       security/selinux/selinuxfs.c        |   56 +++++++++++++++
       security/selinux/ss/Makefile        |    2 +-
       security/selinux/ss/services.c      |    3 +
       security/selinux/ss/status.c        |  129 +++++++++++++++++++++++++++++++++++
       5 files changed, 210 insertions(+), 1 deletions(-)
      Signed-off-by: NJames Morris <jmorris@namei.org>
      11904167
  18. 02 8月, 2010 1 次提交
    • E
      selinux: convert the policy type_attr_map to flex_array · 6371dcd3
      Eric Paris 提交于
      Current selinux policy can have over 3000 types.  The type_attr_map in
      policy is an array sized by the number of types times sizeof(struct ebitmap)
      (12 on x86_64).  Basic math tells us the array is going to be of length
      3000 x 12 = 36,000 bytes.  The largest 'safe' allocation on a long running
      system is 16k.  Most of the time a 32k allocation will work.  But on long
      running systems a 64k allocation (what we need) can fail quite regularly.
      In order to deal with this I am converting the type_attr_map to use
      flex_arrays.  Let the library code deal with breaking this into PAGE_SIZE
      pieces.
      
      -v2
      rework some of the if(!obj) BUG() to be BUG_ON(!obj)
      drop flex_array_put() calls and just use a _get() object directly
      
      -v3
      make apply to James' tree (drop the policydb_write changes)
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen D. Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      6371dcd3
  19. 21 4月, 2010 1 次提交
  20. 09 4月, 2010 1 次提交
  21. 22 2月, 2010 1 次提交
  22. 16 2月, 2010 1 次提交
  23. 04 2月, 2010 1 次提交