1
0
Fork 0
remarkable-linux/fs/notify
Miklos Szeredi 2f5be98162 fsnotify: fix pinning group in fsnotify_prepare_user_wait()
commit 9a31d7ad99 upstream.

Blind increment of group's user_waits is not enough, we could be far enough
in the group's destruction that it isn't taken into account (i.e. grabbing
the mark ref afterwards doesn't guarantee that it was the ref coming from
the _group_ that was grabbed).

Instead we need to check (under lock) that the mark is still attached to
the group after having obtained a ref to the mark.  If not, skip it.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 9385a84d7e ("fsnotify: Pass fsnotify_iter_info into handle_event handler")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:40:47 +00:00
..
dnotify fsnotify: make dnotify_fsnotify_ops const 2017-08-30 16:02:48 +02:00
fanotify fanotify: fix fsnotify_prepare_user_wait() failure 2017-11-30 08:40:45 +00:00
inotify License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig rcu: Make SRCU optional by using CONFIG_SRCU 2015-01-06 11:04:29 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fdinfo.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fdinfo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsnotify.c fsnotify: pin both inode and vfsmount mark 2017-11-30 08:40:47 +00:00
fsnotify.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
group.c fsnotify: Remove fsnotify_detach_group_marks() 2017-04-10 17:37:36 +02:00
mark.c fsnotify: fix pinning group in fsnotify_prepare_user_wait() 2017-11-30 08:40:47 +00:00
notification.c fsnotify: clean up spinlock assertions 2016-10-07 18:46:26 -07:00