1. 04 4月, 2012 1 次提交
  2. 01 4月, 2012 4 次提交
    • A
      get rid of pointless includes of ext2_fs.h · 2f99c369
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2f99c369
    • A
      selinuxfs: merge dentry allocation into sel_make_dir() · a1c2aa1e
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a1c2aa1e
    • L
      selinux: inline avc_audit() and avc_has_perm_noaudit() into caller · cdb0f9a1
      Linus Torvalds 提交于
      Now that all the slow-path code is gone from these functions, we can
      inline them into the main caller - avc_has_perm_flags().
      
      Now the compiler can see that 'avc' is allocated on the stack for this
      case, which helps register pressure a bit.  It also actually shrinks the
      total stack frame, because the stack frame that avc_has_perm_flags()
      always needed (for that 'avc' allocation) is now sufficient for the
      inlined functions too.
      
      Inlining isn't bad - but mindless inlining of cold code (see the
      previous commit) is.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cdb0f9a1
    • L
      selinux: don't inline slow-path code into avc_has_perm_noaudit() · a554bea8
      Linus Torvalds 提交于
      The selinux AVC paths remain some of the hottest (and deepest) codepaths
      at filename lookup time, and we make it worse by having the slow path
      cases take up I$ and stack space even when they don't trigger.  Gcc
      tends to always want to inline functions that are just called once -
      never mind that this might make for slower and worse code in the caller.
      
      So this tries to improve on it a bit by making the slow-path cases
      explicitly separate functions that are marked noinline, causing gcc to
      at least no longer allocate stack space for them unless they are
      actually called.  It also seems to help register allocation a tiny bit,
      since gcc now doesn't take the slow case code into account.
      
      Uninlining the slow path may also allow us to inline the remaining hot
      path into the one caller that actually matters: avc_has_perm_flags().
      I'll have to look at that separately, but both avc_audit() and
      avc_has_perm_noaudit() are now small and lean enough that inlining them
      may make sense.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a554bea8
  3. 29 3月, 2012 1 次提交
  4. 26 3月, 2012 1 次提交
    • D
      SELinux: selinux/xfrm.h needs net/flow.h · 778aae84
      David Howells 提交于
      selinux/xfrm.h needs to #include net/flow.h or else suffer:
      
      In file included from security/selinux/ss/services.c:69:0:
      security/selinux/include/xfrm.h: In function 'selinux_xfrm_notify_policyload':
      security/selinux/include/xfrm.h:53:14: error: 'flow_cache_genid' undeclared (first use in this function)
      security/selinux/include/xfrm.h:53:14: note: each undeclared identifier is reported only once for each function it appears in
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      778aae84
  5. 23 3月, 2012 1 次提交
    • L
      security: optimize avc_audit() common path · 48aab2f7
      Linus Torvalds 提交于
      avc_audit() did a lot of jumping around and had a big stack frame, all
      for the uncommon case.
      
      Split up the uncommon case (which we really can't make go fast anyway)
      into its own slow function, and mark the conditional branches
      appropriately for the common likely case.
      
      This causes avc_audit() to no longer show up as one of the hottest
      functions on the branch profiles (the new "perf -b" thing), and makes
      the cycle profiles look really nice and dense too.
      
      The whole audit path is still annoyingly very much one of the biggest
      costs of name lookup, so these things are worth optimizing for.  I wish
      we could just tell people to turn it off, but realistically we do need
      it: we just need to make sure that the overhead of the necessary evil is
      as low as possible.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      48aab2f7
  6. 20 2月, 2012 1 次提交
    • D
      Replace the fd_sets in struct fdtable with an array of unsigned longs · 1fd36adc
      David Howells 提交于
      Replace the fd_sets in struct fdtable with an array of unsigned longs and then
      use the standard non-atomic bit operations rather than the FD_* macros.
      
      This:
      
       (1) Removes the abuses of struct fd_set:
      
           (a) Since we don't want to allocate a full fd_set the vast majority of the
           	 time, we actually, in effect, just allocate a just-big-enough array of
           	 unsigned longs and cast it to an fd_set type - so why bother with the
           	 fd_set at all?
      
           (b) Some places outside of the core fdtable handling code (such as
           	 SELinux) want to look inside the array of unsigned longs hidden inside
           	 the fd_set struct for more efficient iteration over the entire set.
      
       (2) Eliminates the use of FD_*() macros in the kernel completely.
      
       (3) Permits the __FD_*() macros to be deleted entirely where not exposed to
           userspace.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Link: http://lkml.kernel.org/r/20120216174954.23314.48147.stgit@warthog.procyon.org.ukSigned-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      1fd36adc
  7. 14 2月, 2012 1 次提交
  8. 07 1月, 2012 1 次提交
  9. 06 1月, 2012 9 次提交
  10. 04 1月, 2012 4 次提交
  11. 21 12月, 2011 2 次提交
    • D
      SELinux: Fix RCU deref check warning in sel_netport_insert() · 50345f1e
      David Howells 提交于
      Fix the following bug in sel_netport_insert() where rcu_dereference() should
      be rcu_dereference_protected() as sel_netport_lock is held.
      
      ===================================================
      [ INFO: suspicious rcu_dereference_check() usage. ]
      ---------------------------------------------------
      security/selinux/netport.c:127 invoked rcu_dereference_check() without protection!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 1, debug_locks = 0
      1 lock held by ossec-rootcheck/3323:
       #0:  (sel_netport_lock){+.....}, at: [<ffffffff8117d775>] sel_netport_sid+0xbb/0x226
      
      stack backtrace:
      Pid: 3323, comm: ossec-rootcheck Not tainted 3.1.0-rc8-fsdevel+ #1095
      Call Trace:
       [<ffffffff8105cfb7>] lockdep_rcu_dereference+0xa7/0xb0
       [<ffffffff8117d871>] sel_netport_sid+0x1b7/0x226
       [<ffffffff8117d6ba>] ? sel_netport_avc_callback+0xbc/0xbc
       [<ffffffff8117556c>] selinux_socket_bind+0x115/0x230
       [<ffffffff810a5388>] ? might_fault+0x4e/0x9e
       [<ffffffff810a53d1>] ? might_fault+0x97/0x9e
       [<ffffffff81171cf4>] security_socket_bind+0x11/0x13
       [<ffffffff812ba967>] sys_bind+0x56/0x95
       [<ffffffff81380dac>] ? sysret_check+0x27/0x62
       [<ffffffff8105b767>] ? trace_hardirqs_on_caller+0x11e/0x155
       [<ffffffff81076fcd>] ? audit_syscall_entry+0x17b/0x1ae
       [<ffffffff811b5eae>] ? trace_hardirqs_on_thunk+0x3a/0x3f
       [<ffffffff81380d7b>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Morris <jmorris@namei.org>
      50345f1e
    • D
      SELinux: Fix RCU deref check warning in sel_netport_insert() · 94d4ef0c
      David Howells 提交于
      Fix the following bug in sel_netport_insert() where rcu_dereference() should
      be rcu_dereference_protected() as sel_netport_lock is held.
      
      ===================================================
      [ INFO: suspicious rcu_dereference_check() usage. ]
      ---------------------------------------------------
      security/selinux/netport.c:127 invoked rcu_dereference_check() without protection!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 1, debug_locks = 0
      1 lock held by ossec-rootcheck/3323:
       #0:  (sel_netport_lock){+.....}, at: [<ffffffff8117d775>] sel_netport_sid+0xbb/0x226
      
      stack backtrace:
      Pid: 3323, comm: ossec-rootcheck Not tainted 3.1.0-rc8-fsdevel+ #1095
      Call Trace:
       [<ffffffff8105cfb7>] lockdep_rcu_dereference+0xa7/0xb0
       [<ffffffff8117d871>] sel_netport_sid+0x1b7/0x226
       [<ffffffff8117d6ba>] ? sel_netport_avc_callback+0xbc/0xbc
       [<ffffffff8117556c>] selinux_socket_bind+0x115/0x230
       [<ffffffff810a5388>] ? might_fault+0x4e/0x9e
       [<ffffffff810a53d1>] ? might_fault+0x97/0x9e
       [<ffffffff81171cf4>] security_socket_bind+0x11/0x13
       [<ffffffff812ba967>] sys_bind+0x56/0x95
       [<ffffffff81380dac>] ? sysret_check+0x27/0x62
       [<ffffffff8105b767>] ? trace_hardirqs_on_caller+0x11e/0x155
       [<ffffffff81076fcd>] ? audit_syscall_entry+0x17b/0x1ae
       [<ffffffff811b5eae>] ? trace_hardirqs_on_thunk+0x3a/0x3f
       [<ffffffff81380d7b>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      94d4ef0c
  12. 19 12月, 2011 1 次提交
  13. 07 12月, 2011 1 次提交
  14. 04 12月, 2011 1 次提交
  15. 23 11月, 2011 1 次提交
  16. 16 11月, 2011 1 次提交
  17. 01 11月, 2011 1 次提交
  18. 10 9月, 2011 7 次提交
  19. 02 8月, 2011 1 次提交