27 Jul, 2016

1 commit

  • 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: Arnd Bergmann
    Fixes: 6059f71f1e94 ("apparmor: add parameter to control whether policy hashing is used")
    Signed-off-by: John Johansen
    Signed-off-by: James Morris

    Arnd Bergmann
     

12 Jul, 2016

24 commits


28 Mar, 2016

12 commits


22 Oct, 2015

1 commit

  • The crypto framework can be built as a loadable module, but the
    apparmor hash code can only be built-in, which then causes a
    link error:

    security/built-in.o: In function `aa_calc_profile_hash':
    integrity_audit.c:(.text+0x21610): undefined reference to `crypto_shash_update'
    security/built-in.o: In function `init_profile_hash':
    integrity_audit.c:(.init.text+0xb4c): undefined reference to `crypto_alloc_shash'

    This changes Apparmor to use 'select CRYPTO' like a lot of other
    subsystems do.

    Signed-off-by: Arnd Bergmann
    Acked-by: John Johansen
    Signed-off-by: James Morris

    Arnd Bergmann
     

02 Jul, 2015

1 commit

  • Pull module updates from Rusty Russell:
    "Main excitement here is Peter Zijlstra's lockless rbtree optimization
    to speed module address lookup. He found some abusers of the module
    lock doing that too.

    A little bit of parameter work here too; including Dan Streetman's
    breaking up the big param mutex so writing a parameter can load
    another module (yeah, really). Unfortunately that broke the usual
    suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were
    appended too"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits)
    modules: only use mod->param_lock if CONFIG_MODULES
    param: fix module param locks when !CONFIG_SYSFS.
    rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE()
    module: add per-module param_lock
    module: make perm const
    params: suppress unused variable error, warn once just in case code changes.
    modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'.
    kernel/module.c: avoid ifdefs for sig_enforce declaration
    kernel/workqueue.c: remove ifdefs over wq_power_efficient
    kernel/params.c: export param_ops_bool_enable_only
    kernel/params.c: generalize bool_enable_only
    kernel/module.c: use generic module param operaters for sig_enforce
    kernel/params: constify struct kernel_param_ops uses
    sysfs: tightened sysfs permission checks
    module: Rework module_addr_{min,max}
    module: Use __module_address() for module_address_lookup()
    module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING
    module: Optimize __module_address() using a latched RB-tree
    rbtree: Implement generic latch_tree
    seqlock: Introduce raw_read_seqcount_latch()
    ...

    Linus Torvalds
     

28 May, 2015

1 commit

  • 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
    Cc: Junio C Hamano
    Cc: Andrew Morton
    Cc: Kees Cook
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: cocci@systeme.lip6.fr
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Rusty Russell

    Luis R. Rodriguez