1. 28 3月, 2016 4 次提交
  2. 28 5月, 2015 1 次提交
    • L
      kernel/params: constify struct kernel_param_ops uses · 9c27847d
      Luis R. Rodriguez 提交于
      Most code already uses consts for the struct kernel_param_ops,
      sweep the kernel for the last offending stragglers. Other than
      include/linux/moduleparam.h and kernel/params.c all other changes
      were generated with the following Coccinelle SmPL patch. Merge
      conflicts between trees can be handled with Coccinelle.
      
      In the future git could get Coccinelle merge support to deal with
      patch --> fail --> grammar --> Coccinelle --> new patch conflicts
      automatically for us on patches where the grammar is available and
      the patch is of high confidence. Consider this a feature request.
      
      Test compiled on x86_64 against:
      
      	* allnoconfig
      	* allmodconfig
      	* allyesconfig
      
      @ const_found @
      identifier ops;
      @@
      
      const struct kernel_param_ops ops = {
      };
      
      @ const_not_found depends on !const_found @
      identifier ops;
      @@
      
      -struct kernel_param_ops ops = {
      +const struct kernel_param_ops ops = {
      };
      
      Generated-by: Coccinelle SmPL
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Junio C Hamano <gitster@pobox.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: cocci@systeme.lip6.fr
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9c27847d
  3. 12 5月, 2015 3 次提交
  4. 16 4月, 2015 1 次提交
  5. 12 4月, 2015 1 次提交
  6. 23 2月, 2015 1 次提交
  7. 27 8月, 2014 1 次提交
  8. 06 2月, 2014 1 次提交
  9. 30 10月, 2013 1 次提交
  10. 20 8月, 2013 1 次提交
  11. 15 8月, 2013 3 次提交
  12. 28 4月, 2013 5 次提交
  13. 23 2月, 2013 1 次提交
  14. 21 9月, 2012 1 次提交
  15. 01 6月, 2012 2 次提交
  16. 10 4月, 2012 3 次提交
  17. 04 4月, 2012 1 次提交
  18. 13 1月, 2012 1 次提交
  19. 07 1月, 2012 1 次提交
  20. 06 1月, 2012 1 次提交
    • E
      capabilities: remove the task from capable LSM hook entirely · 6a9de491
      Eric Paris 提交于
      The capabilities framework is based around credentials, not necessarily the
      current task.  Yet we still passed the current task down into LSMs from the
      security_capable() LSM hook as if it was a meaningful portion of the security
      decision.  This patch removes the 'generic' passing of current and instead
      forces individual LSMs to use current explicitly if they think it is
      appropriate.  In our case those LSMs are SELinux and AppArmor.
      
      I believe the AppArmor use of current is incorrect, but that is wholely
      unrelated to this patch.  This patch does not change what AppArmor does, it
      just makes it clear in the AppArmor code that it is doing it.
      
      The SELinux code still uses current in it's audit message, which may also be
      wrong and needs further investigation.  Again this is NOT a change, it may
      have always been wrong, this patch just makes it clear what is happening.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      6a9de491
  21. 04 1月, 2012 3 次提交
  22. 16 12月, 2011 1 次提交
  23. 29 6月, 2011 1 次提交
    • J
      AppArmor: Fix masking of capabilities in complain mode · 25e75dff
      John Johansen 提交于
      AppArmor is masking the capabilities returned by capget against the
      capabilities mask in the profile.  This is wrong, in complain mode the
      profile has effectively all capabilities, as the profile restrictions are
      not being enforced, merely tested against to determine if an access is
      known by the profile.
      
      This can result in the wrong behavior of security conscience applications
      like sshd which examine their capability set, and change their behavior
      accordingly.  In this case because of the masked capability set being
      returned sshd fails due to DAC checks, even when the profile is in complain
      mode.
      
      Kernels affected: 2.6.36 - 3.0.
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      25e75dff
  24. 09 6月, 2011 1 次提交
    • J
      AppArmor: Fix sleep in invalid context from task_setrlimit · 1780f2d3
      John Johansen 提交于
      Affected kernels 2.6.36 - 3.0
      
      AppArmor may do a GFP_KERNEL memory allocation with task_lock(tsk->group_leader);
      held when called from security_task_setrlimit.  This will only occur when the
      task's current policy has been replaced, and the task's creds have not been
      updated before entering the LSM security_task_setrlimit() hook.
      
      BUG: sleeping function called from invalid context at mm/slub.c:847
       in_atomic(): 1, irqs_disabled(): 0, pid: 1583, name: cupsd
       2 locks held by cupsd/1583:
        #0:  (tasklist_lock){.+.+.+}, at: [<ffffffff8104dafa>] do_prlimit+0x61/0x189
        #1:  (&(&p->alloc_lock)->rlock){+.+.+.}, at: [<ffffffff8104db2d>]
      do_prlimit+0x94/0x189
       Pid: 1583, comm: cupsd Not tainted 3.0.0-rc2-git1 #7
       Call Trace:
        [<ffffffff8102ebf2>] __might_sleep+0x10d/0x112
        [<ffffffff810e6f46>] slab_pre_alloc_hook.isra.49+0x2d/0x33
        [<ffffffff810e7bc4>] kmem_cache_alloc+0x22/0x132
        [<ffffffff8105b6e6>] prepare_creds+0x35/0xe4
        [<ffffffff811c0675>] aa_replace_current_profile+0x35/0xb2
        [<ffffffff811c4d2d>] aa_current_profile+0x45/0x4c
        [<ffffffff811c4d4d>] apparmor_task_setrlimit+0x19/0x3a
        [<ffffffff811beaa5>] security_task_setrlimit+0x11/0x13
        [<ffffffff8104db6b>] do_prlimit+0xd2/0x189
        [<ffffffff8104dea9>] sys_setrlimit+0x3b/0x48
        [<ffffffff814062bb>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Reported-by: NMiles Lane <miles.lane@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Morris <jmorris@namei.org>
      1780f2d3