1. 16 1月, 2017 1 次提交
    • T
      AppArmor: Use GFP_KERNEL for __aa_kvmalloc(). · a7f6c1b6
      Tetsuo Handa 提交于
      Calling kmalloc(GFP_NOIO) with order == PAGE_ALLOC_COSTLY_ORDER is not
      recommended because it might fall into infinite retry loop without
      invoking the OOM killer.
      
      Since aa_dfa_unpack() is the only caller of kvzalloc() and
      aa_dfa_unpack() which is calling kvzalloc() via unpack_table() is
      doing kzalloc(GFP_KERNEL), it is safe to use GFP_KERNEL from
      __aa_kvmalloc().
      
      Since aa_simple_write_to_buffer() is the only caller of kvmalloc()
      and aa_simple_write_to_buffer() is calling copy_from_user() which
      is GFP_KERNEL context (see memdup_user_nul()), it is safe to use
      GFP_KERNEL from __aa_kvmalloc().
      
      Therefore, replace GFP_NOIO with GFP_KERNEL. Also, since we have
      vmalloc() fallback, add __GFP_NORETRY so that we don't invoke the OOM
      killer by kmalloc(GFP_KERNEL) with order == PAGE_ALLOC_COSTLY_ORDER.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      a7f6c1b6
  2. 21 11月, 2016 1 次提交
  3. 28 9月, 2016 1 次提交
  4. 27 7月, 2016 1 次提交
    • A
      apparmor: fix SECURITY_APPARMOR_HASH_DEFAULT parameter handling · 7616ac70
      Arnd Bergmann 提交于
      The newly added Kconfig option could never work and just causes a build error
      when disabled:
      
      security/apparmor/lsm.c:675:25: error: 'CONFIG_SECURITY_APPARMOR_HASH_DEFAULT' undeclared here (not in a function)
       bool aa_g_hash_policy = CONFIG_SECURITY_APPARMOR_HASH_DEFAULT;
      
      The problem is that the macro undefined in this case, and we need to use the IS_ENABLED()
      helper to turn it into a boolean constant.
      
      Another minor problem with the original patch is that the option is even offered
      in sysfs when SECURITY_APPARMOR_HASH is not enabled, so this also hides the option
      in that case.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 6059f71f ("apparmor: add parameter to control whether policy hashing is used")
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      7616ac70
  5. 12 7月, 2016 24 次提交
  6. 08 7月, 2016 1 次提交
  7. 28 3月, 2016 11 次提交