• Roberto Sassu's avatar
    integrity: Move integrity_kernel_module_request() to IMA · 06cca511
    Roberto Sassu authored
    In preparation for removing the 'integrity' LSM, move
    integrity_kernel_module_request() to IMA, and rename it to
    ima_kernel_module_request(). Rewrite the function documentation, to explain
    better what the problem is.
    
    Compile it conditionally if CONFIG_INTEGRITY_ASYMMETRIC_KEYS is enabled,
    and call it from security.c (removed afterwards with the move of IMA to the
    LSM infrastructure).
    
    Adding this hook cannot be avoided, since IMA has no control on the flags
    passed to crypto_alloc_sig() in public_key_verify_signature(), and thus
    cannot pass CRYPTO_NOLOAD, which solved the problem for EVM hashing with
    commit e2861fa7 ("evm: Don't deadlock if a crypto algorithm is
    unavailable").
    
    EVM alone does not need to implement this hook, first because there is no
    mutex to deadlock, and second because even if it had it, there should be a
    recursive call. However, since verification from EVM can be initiated only
    by setting inode metadata, deadlock would occur if modprobe would do the
    same while loading a kernel module (which is unlikely).
    Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
    Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    Acked-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
    06cca511
digsig_asymmetric.c 2.92 KB