diff options
-rw-r--r-- | drivers/infiniband/core/device.c | 6 | ||||
-rw-r--r-- | include/linux/security.h | 12 | ||||
-rw-r--r-- | security/security.c | 23 | ||||
-rw-r--r-- | security/selinux/hooks.c | 2 | ||||
-rw-r--r-- | security/selinux/selinuxfs.c | 2 |
5 files changed, 24 insertions, 21 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 78dc07c6ac4b..61c0c93a2e73 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -2499,7 +2499,7 @@ static int __init ib_core_init(void) | |||
2499 | goto err_mad; | 2499 | goto err_mad; |
2500 | } | 2500 | } |
2501 | 2501 | ||
2502 | ret = register_lsm_notifier(&ibdev_lsm_nb); | 2502 | ret = register_blocking_lsm_notifier(&ibdev_lsm_nb); |
2503 | if (ret) { | 2503 | if (ret) { |
2504 | pr_warn("Couldn't register LSM notifier. ret %d\n", ret); | 2504 | pr_warn("Couldn't register LSM notifier. ret %d\n", ret); |
2505 | goto err_sa; | 2505 | goto err_sa; |
@@ -2518,7 +2518,7 @@ static int __init ib_core_init(void) | |||
2518 | return 0; | 2518 | return 0; |
2519 | 2519 | ||
2520 | err_compat: | 2520 | err_compat: |
2521 | unregister_lsm_notifier(&ibdev_lsm_nb); | 2521 | unregister_blocking_lsm_notifier(&ibdev_lsm_nb); |
2522 | err_sa: | 2522 | err_sa: |
2523 | ib_sa_cleanup(); | 2523 | ib_sa_cleanup(); |
2524 | err_mad: | 2524 | err_mad: |
@@ -2544,7 +2544,7 @@ static void __exit ib_core_cleanup(void) | |||
2544 | nldev_exit(); | 2544 | nldev_exit(); |
2545 | rdma_nl_unregister(RDMA_NL_LS); | 2545 | rdma_nl_unregister(RDMA_NL_LS); |
2546 | unregister_pernet_device(&rdma_dev_net_ops); | 2546 | unregister_pernet_device(&rdma_dev_net_ops); |
2547 | unregister_lsm_notifier(&ibdev_lsm_nb); | 2547 | unregister_blocking_lsm_notifier(&ibdev_lsm_nb); |
2548 | ib_sa_cleanup(); | 2548 | ib_sa_cleanup(); |
2549 | ib_mad_cleanup(); | 2549 | ib_mad_cleanup(); |
2550 | addr_cleanup(); | 2550 | addr_cleanup(); |
diff --git a/include/linux/security.h b/include/linux/security.h index 659071c2e57c..5f7441abbf42 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -189,9 +189,9 @@ static inline const char *kernel_load_data_id_str(enum kernel_load_data_id id) | |||
189 | 189 | ||
190 | #ifdef CONFIG_SECURITY | 190 | #ifdef CONFIG_SECURITY |
191 | 191 | ||
192 | int call_lsm_notifier(enum lsm_event event, void *data); | 192 | int call_blocking_lsm_notifier(enum lsm_event event, void *data); |
193 | int register_lsm_notifier(struct notifier_block *nb); | 193 | int register_blocking_lsm_notifier(struct notifier_block *nb); |
194 | int unregister_lsm_notifier(struct notifier_block *nb); | 194 | int unregister_blocking_lsm_notifier(struct notifier_block *nb); |
195 | 195 | ||
196 | /* prototypes */ | 196 | /* prototypes */ |
197 | extern int security_init(void); | 197 | extern int security_init(void); |
@@ -394,17 +394,17 @@ int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen); | |||
394 | int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); | 394 | int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); |
395 | #else /* CONFIG_SECURITY */ | 395 | #else /* CONFIG_SECURITY */ |
396 | 396 | ||
397 | static inline int call_lsm_notifier(enum lsm_event event, void *data) | 397 | static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data) |
398 | { | 398 | { |
399 | return 0; | 399 | return 0; |
400 | } | 400 | } |
401 | 401 | ||
402 | static inline int register_lsm_notifier(struct notifier_block *nb) | 402 | static inline int register_blocking_lsm_notifier(struct notifier_block *nb) |
403 | { | 403 | { |
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
406 | 406 | ||
407 | static inline int unregister_lsm_notifier(struct notifier_block *nb) | 407 | static inline int unregister_blocking_lsm_notifier(struct notifier_block *nb) |
408 | { | 408 | { |
409 | return 0; | 409 | return 0; |
410 | } | 410 | } |
diff --git a/security/security.c b/security/security.c index 613a5c00e602..47e5849d7557 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #define LSM_COUNT (__end_lsm_info - __start_lsm_info) | 39 | #define LSM_COUNT (__end_lsm_info - __start_lsm_info) |
40 | 40 | ||
41 | struct security_hook_heads security_hook_heads __lsm_ro_after_init; | 41 | struct security_hook_heads security_hook_heads __lsm_ro_after_init; |
42 | static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain); | 42 | static BLOCKING_NOTIFIER_HEAD(blocking_lsm_notifier_chain); |
43 | 43 | ||
44 | static struct kmem_cache *lsm_file_cache; | 44 | static struct kmem_cache *lsm_file_cache; |
45 | static struct kmem_cache *lsm_inode_cache; | 45 | static struct kmem_cache *lsm_inode_cache; |
@@ -430,23 +430,26 @@ void __init security_add_hooks(struct security_hook_list *hooks, int count, | |||
430 | panic("%s - Cannot get early memory.\n", __func__); | 430 | panic("%s - Cannot get early memory.\n", __func__); |
431 | } | 431 | } |
432 | 432 | ||
433 | int call_lsm_notifier(enum lsm_event event, void *data) | 433 | int call_blocking_lsm_notifier(enum lsm_event event, void *data) |
434 | { | 434 | { |
435 | return atomic_notifier_call_chain(&lsm_notifier_chain, event, data); | 435 | return blocking_notifier_call_chain(&blocking_lsm_notifier_chain, |
436 | event, data); | ||
436 | } | 437 | } |
437 | EXPORT_SYMBOL(call_lsm_notifier); | 438 | EXPORT_SYMBOL(call_blocking_lsm_notifier); |
438 | 439 | ||
439 | int register_lsm_notifier(struct notifier_block *nb) | 440 | int register_blocking_lsm_notifier(struct notifier_block *nb) |
440 | { | 441 | { |
441 | return atomic_notifier_chain_register(&lsm_notifier_chain, nb); | 442 | return blocking_notifier_chain_register(&blocking_lsm_notifier_chain, |
443 | nb); | ||
442 | } | 444 | } |
443 | EXPORT_SYMBOL(register_lsm_notifier); | 445 | EXPORT_SYMBOL(register_blocking_lsm_notifier); |
444 | 446 | ||
445 | int unregister_lsm_notifier(struct notifier_block *nb) | 447 | int unregister_blocking_lsm_notifier(struct notifier_block *nb) |
446 | { | 448 | { |
447 | return atomic_notifier_chain_unregister(&lsm_notifier_chain, nb); | 449 | return blocking_notifier_chain_unregister(&blocking_lsm_notifier_chain, |
450 | nb); | ||
448 | } | 451 | } |
449 | EXPORT_SYMBOL(unregister_lsm_notifier); | 452 | EXPORT_SYMBOL(unregister_blocking_lsm_notifier); |
450 | 453 | ||
451 | /** | 454 | /** |
452 | * lsm_cred_alloc - allocate a composite cred blob | 455 | * lsm_cred_alloc - allocate a composite cred blob |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index c61787b15f27..c1e37018c8eb 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -197,7 +197,7 @@ static int selinux_lsm_notifier_avc_callback(u32 event) | |||
197 | { | 197 | { |
198 | if (event == AVC_CALLBACK_RESET) { | 198 | if (event == AVC_CALLBACK_RESET) { |
199 | sel_ib_pkey_flush(); | 199 | sel_ib_pkey_flush(); |
200 | call_lsm_notifier(LSM_POLICY_CHANGE, NULL); | 200 | call_blocking_lsm_notifier(LSM_POLICY_CHANGE, NULL); |
201 | } | 201 | } |
202 | 202 | ||
203 | return 0; | 203 | return 0; |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 145ee62f205a..1e2e3e4b5fdb 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -180,7 +180,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf, | |||
180 | selnl_notify_setenforce(new_value); | 180 | selnl_notify_setenforce(new_value); |
181 | selinux_status_update_setenforce(state, new_value); | 181 | selinux_status_update_setenforce(state, new_value); |
182 | if (!new_value) | 182 | if (!new_value) |
183 | call_lsm_notifier(LSM_POLICY_CHANGE, NULL); | 183 | call_blocking_lsm_notifier(LSM_POLICY_CHANGE, NULL); |
184 | } | 184 | } |
185 | length = count; | 185 | length = count; |
186 | out: | 186 | out: |