summaryrefslogtreecommitdiff
path: root/security/security.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index 46f405ce6b0f..81a555c14a35 100644
--- a/security/security.c
+++ b/security/security.c
@@ -513,6 +513,14 @@ int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode
}
EXPORT_SYMBOL_GPL(security_inode_create);
+int security_inode_post_create(struct inode *dir, struct dentry *dentry,
+ umode_t mode)
+{
+ if (unlikely(IS_PRIVATE(dir)))
+ return 0;
+ return call_int_hook(inode_post_create, 0, dir, dentry, mode);
+}
+
int security_inode_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *new_dentry)
{
@@ -844,6 +852,16 @@ int security_file_open(struct file *file, const struct cred *cred)
return fsnotify_perm(file, MAY_OPEN);
}
+int security_file_close(struct file *file)
+{
+ return call_int_hook(file_close, 0, file);
+}
+
+bool security_allow_merge_bio(struct bio *bio1, struct bio *bio2)
+{
+ return call_int_hook(allow_merge_bio, 1, bio1, bio2);
+}
+
int security_task_create(unsigned long clone_flags)
{
return call_int_hook(task_create, 0, clone_flags);
@@ -1614,6 +1632,7 @@ struct security_hook_heads security_hook_heads = {
.inode_init_security =
LIST_HEAD_INIT(security_hook_heads.inode_init_security),
.inode_create = LIST_HEAD_INIT(security_hook_heads.inode_create),
+ .inode_post_create = LIST_HEAD_INIT(security_hook_heads.inode_post_create),
.inode_link = LIST_HEAD_INIT(security_hook_heads.inode_link),
.inode_unlink = LIST_HEAD_INIT(security_hook_heads.inode_unlink),
.inode_symlink =
@@ -1673,6 +1692,8 @@ struct security_hook_heads security_hook_heads = {
LIST_HEAD_INIT(security_hook_heads.file_send_sigiotask),
.file_receive = LIST_HEAD_INIT(security_hook_heads.file_receive),
.file_open = LIST_HEAD_INIT(security_hook_heads.file_open),
+ .file_close = LIST_HEAD_INIT(security_hook_heads.file_close),
+ .allow_merge_bio = LIST_HEAD_INIT(security_hook_heads.allow_merge_bio),
.task_create = LIST_HEAD_INIT(security_hook_heads.task_create),
.task_free = LIST_HEAD_INIT(security_hook_heads.task_free),
.cred_alloc_blank =