]> git.baikalelectronics.ru Git - kernel.git/commit
fsnotify: pin both inode and vfsmount mark
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 30 Oct 2017 20:14:55 +0000 (21:14 +0100)
committerJan Kara <jack@suse.cz>
Tue, 31 Oct 2017 16:54:56 +0000 (17:54 +0100)
commitc3386332ec9463b12e0012261315e2ad4a19963e
tree681a9c667b5cf48e6166eecf12c9745ffc717fc4
parent1083b851debccf2ee8041b1a56ff6f7a18ac439c
fsnotify: pin both inode and vfsmount mark

We may fail to pin one of the marks in fsnotify_prepare_user_wait() when
dropping the srcu read lock, resulting in use after free at the next
iteration.

Solution is to store both marks in iter_info instead of just the one we'll
be sending the event for.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 105b1606fa96 ("fsnotify: Pass fsnotify_iter_info into handle_event handler")
Cc: <stable@vger.kernel.org> # v4.12
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fsnotify.c