aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-12-21 12:32:48 -0500
committerJan Kara <jack@suse.cz>2017-04-10 11:37:36 -0400
commit7b1293234084ddb6469c4e9a5ef818f399b5786b (patch)
tree0b54695cc96dd0a17c893bcd7743f9aea84d5ce2 /kernel/audit_watch.c
parentebb3b47e37a4ccef33e6388589a21a5c23d6b40b (diff)
fsnotify: Add group pointer in fsnotify_init_mark()
Currently we initialize mark->group only in fsnotify_add_mark_lock(). However we will need to access fsnotify_ops of corresponding group from fsnotify_put_mark() so we need mark->group initialized earlier. Do that in fsnotify_init_mark() which has a consequence that once fsnotify_init_mark() is called on a mark, the mark has to be destroyed by fsnotify_put_mark(). Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'kernel/audit_watch.c')
-rw-r--r--kernel/audit_watch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 956fa584c239..e32efed86828 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -157,9 +157,10 @@ static struct audit_parent *audit_init_parent(struct path *path)
157 157
158 INIT_LIST_HEAD(&parent->watches); 158 INIT_LIST_HEAD(&parent->watches);
159 159
160 fsnotify_init_mark(&parent->mark, audit_watch_free_mark); 160 fsnotify_init_mark(&parent->mark, audit_watch_group,
161 audit_watch_free_mark);
161 parent->mark.mask = AUDIT_FS_WATCH; 162 parent->mark.mask = AUDIT_FS_WATCH;
162 ret = fsnotify_add_mark(&parent->mark, audit_watch_group, inode, NULL, 0); 163 ret = fsnotify_add_mark(&parent->mark, inode, NULL, 0);
163 if (ret < 0) { 164 if (ret < 0) {
164 audit_free_parent(parent); 165 audit_free_parent(parent);
165 return ERR_PTR(ret); 166 return ERR_PTR(ret);