summaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 23:28:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 23:28:59 -0400
commit8b68150883ca466a23e90902dd4113b22e692f04 (patch)
treee27be560379f4dc6f3d49a88f83bf5f9cb539851 /security/security.c
parent0f75ef6a9cff49ff612f7ce0578bced9d0b38325 (diff)
parent650b29dbdf2caf7db27cdc8bfa8fc009b28a6ce3 (diff)
Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
Pull integrity updates from Mimi Zohar: "Bug fixes, code clean up, and new features: - IMA policy rules can be defined in terms of LSM labels, making the IMA policy dependent on LSM policy label changes, in particular LSM label deletions. The new environment, in which IMA-appraisal is being used, frequently updates the LSM policy and permits LSM label deletions. - Prevent an mmap'ed shared file opened for write from also being mmap'ed execute. In the long term, making this and other similar changes at the VFS layer would be preferable. - The IMA per policy rule template format support is needed for a couple of new/proposed features (eg. kexec boot command line measurement, appended signatures, and VFS provided file hashes). - Other than the "boot-aggregate" record in the IMA measuremeent list, all other measurements are of file data. Measuring and storing the kexec boot command line in the IMA measurement list is the first buffer based measurement included in the measurement list" * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: integrity: Introduce struct evm_xattr ima: Update MAX_TEMPLATE_NAME_LEN to fit largest reasonable definition KEXEC: Call ima_kexec_cmdline to measure the boot command line args IMA: Define a new template field buf IMA: Define a new hook to measure the kexec boot command line arguments IMA: support for per policy rule template formats integrity: Fix __integrity_init_keyring() section mismatch ima: Use designated initializers for struct ima_event_data ima: use the lsm policy update notifier LSM: switch to blocking policy update notifiers x86/ima: fix the Kconfig dependency for IMA_ARCH_POLICY ima: Make arch_policy_entry static ima: prevent a file already mmap'ed write to be mmap'ed execute x86/ima: check EFI SetupMode too
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/security/security.c b/security/security.c
index f493db0bf62a..250ee2d76406 100644
--- a/security/security.c
+++ b/security/security.c
@@ -35,7 +35,7 @@
35#define LSM_COUNT (__end_lsm_info - __start_lsm_info) 35#define LSM_COUNT (__end_lsm_info - __start_lsm_info)
36 36
37struct security_hook_heads security_hook_heads __lsm_ro_after_init; 37struct security_hook_heads security_hook_heads __lsm_ro_after_init;
38static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain); 38static BLOCKING_NOTIFIER_HEAD(blocking_lsm_notifier_chain);
39 39
40static struct kmem_cache *lsm_file_cache; 40static struct kmem_cache *lsm_file_cache;
41static struct kmem_cache *lsm_inode_cache; 41static struct kmem_cache *lsm_inode_cache;
@@ -426,23 +426,26 @@ void __init security_add_hooks(struct security_hook_list *hooks, int count,
426 panic("%s - Cannot get early memory.\n", __func__); 426 panic("%s - Cannot get early memory.\n", __func__);
427} 427}
428 428
429int call_lsm_notifier(enum lsm_event event, void *data) 429int call_blocking_lsm_notifier(enum lsm_event event, void *data)
430{ 430{
431 return atomic_notifier_call_chain(&lsm_notifier_chain, event, data); 431 return blocking_notifier_call_chain(&blocking_lsm_notifier_chain,
432 event, data);
432} 433}
433EXPORT_SYMBOL(call_lsm_notifier); 434EXPORT_SYMBOL(call_blocking_lsm_notifier);
434 435
435int register_lsm_notifier(struct notifier_block *nb) 436int register_blocking_lsm_notifier(struct notifier_block *nb)
436{ 437{
437 return atomic_notifier_chain_register(&lsm_notifier_chain, nb); 438 return blocking_notifier_chain_register(&blocking_lsm_notifier_chain,
439 nb);
438} 440}
439EXPORT_SYMBOL(register_lsm_notifier); 441EXPORT_SYMBOL(register_blocking_lsm_notifier);
440 442
441int unregister_lsm_notifier(struct notifier_block *nb) 443int unregister_blocking_lsm_notifier(struct notifier_block *nb)
442{ 444{
443 return atomic_notifier_chain_unregister(&lsm_notifier_chain, nb); 445 return blocking_notifier_chain_unregister(&blocking_lsm_notifier_chain,
446 nb);
444} 447}
445EXPORT_SYMBOL(unregister_lsm_notifier); 448EXPORT_SYMBOL(unregister_blocking_lsm_notifier);
446 449
447/** 450/**
448 * lsm_cred_alloc - allocate a composite cred blob 451 * lsm_cred_alloc - allocate a composite cred blob