alistair23-linux/fs/notify
Miklos Szeredi f37650f1c7 fanotify: fix fsnotify_prepare_user_wait() failure
If fsnotify_prepare_user_wait() fails, we leave the event on the
notification list.  Which will result in a warning in
fsnotify_destroy_event() and later use-after-free.

Instead of adding a new helper to remove the event from the list in this
case, I opted to move the prepare/finish up into fanotify_handle_event().

This will allow these to be moved further out into the generic code later,
and perhaps let us move to non-sleeping RCU.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 05f0e38724 ("fanotify: Release SRCU lock when waiting for userspace response")
Cc: <stable@vger.kernel.org> # v4.12
Signed-off-by: Jan Kara <jack@suse.cz>
2017-10-31 17:54:56 +01:00
..
dnotify dnotify: Handle errors from fsnotify_add_mark_locked() in fcntl_dirnotify() 2017-10-31 17:41:04 +01:00
fanotify fanotify: fix fsnotify_prepare_user_wait() failure 2017-10-31 17:54:56 +01:00
inotify fsnotify: Move ->free_mark callback to fsnotify_ops 2017-04-10 17:37:36 +02:00
fdinfo.c fsnotify: Move object pointer to fsnotify_mark_connector 2017-04-10 17:37:35 +02:00
fdinfo.h
fsnotify.c fsnotify: pin both inode and vfsmount mark 2017-10-31 17:54:56 +01:00
fsnotify.h fsnotify: Remove fsnotify_find_{inode|vfsmount}_mark() 2017-04-10 17:37:36 +02:00
group.c fsnotify: convert fsnotify_group.refcnt from atomic_t to refcount_t 2017-10-31 17:54:56 +01:00
Kconfig rcu: Make SRCU optional by using CONFIG_SRCU 2015-01-06 11:04:29 -08:00
Makefile fsnotify: Drop inode_mark.c 2017-04-10 17:37:36 +02:00
mark.c fsnotify: fix pinning group in fsnotify_prepare_user_wait() 2017-10-31 17:54:56 +01:00
notification.c fsnotify: clean up spinlock assertions 2016-10-07 18:46:26 -07:00