mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
LSM: switch to blocking policy update notifiers
Atomic policy updaters are not very useful as they cannot usually perform the policy updates on their own. Since it seems that there is no strict need for the atomicity, switch to the blocking variant. While doing so, rename the functions accordingly. Signed-off-by: Janne Karhunen <janne.karhunen@gmail.com> Acked-by: Paul Moore <paul@paul-moore.com> Acked-by: James Morris <jamorris@linux.microsoft.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
9e1e5d4372
commit
42df744c41
5 changed files with 24 additions and 21 deletions
|
@ -39,7 +39,7 @@
|
|||
#define LSM_COUNT (__end_lsm_info - __start_lsm_info)
|
||||
|
||||
struct security_hook_heads security_hook_heads __lsm_ro_after_init;
|
||||
static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain);
|
||||
static BLOCKING_NOTIFIER_HEAD(blocking_lsm_notifier_chain);
|
||||
|
||||
static struct kmem_cache *lsm_file_cache;
|
||||
static struct kmem_cache *lsm_inode_cache;
|
||||
|
@ -430,23 +430,26 @@ void __init security_add_hooks(struct security_hook_list *hooks, int count,
|
|||
panic("%s - Cannot get early memory.\n", __func__);
|
||||
}
|
||||
|
||||
int call_lsm_notifier(enum lsm_event event, void *data)
|
||||
int call_blocking_lsm_notifier(enum lsm_event event, void *data)
|
||||
{
|
||||
return atomic_notifier_call_chain(&lsm_notifier_chain, event, data);
|
||||
return blocking_notifier_call_chain(&blocking_lsm_notifier_chain,
|
||||
event, data);
|
||||
}
|
||||
EXPORT_SYMBOL(call_lsm_notifier);
|
||||
EXPORT_SYMBOL(call_blocking_lsm_notifier);
|
||||
|
||||
int register_lsm_notifier(struct notifier_block *nb)
|
||||
int register_blocking_lsm_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return atomic_notifier_chain_register(&lsm_notifier_chain, nb);
|
||||
return blocking_notifier_chain_register(&blocking_lsm_notifier_chain,
|
||||
nb);
|
||||
}
|
||||
EXPORT_SYMBOL(register_lsm_notifier);
|
||||
EXPORT_SYMBOL(register_blocking_lsm_notifier);
|
||||
|
||||
int unregister_lsm_notifier(struct notifier_block *nb)
|
||||
int unregister_blocking_lsm_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return atomic_notifier_chain_unregister(&lsm_notifier_chain, nb);
|
||||
return blocking_notifier_chain_unregister(&blocking_lsm_notifier_chain,
|
||||
nb);
|
||||
}
|
||||
EXPORT_SYMBOL(unregister_lsm_notifier);
|
||||
EXPORT_SYMBOL(unregister_blocking_lsm_notifier);
|
||||
|
||||
/**
|
||||
* lsm_cred_alloc - allocate a composite cred blob
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue