linux/fs/notify/fanotify
Jan Kara b1da6a5187 fsnotify: Fix NULL ptr deref in fanotify_get_fsid()
fanotify_get_fsid() is reading mark->connector->fsid under srcu. It can
happen that it sees mark not fully initialized or mark that is already
detached from the object list. In these cases mark->connector
can be NULL leading to NULL ptr dereference. Fix the problem by
being careful when reading mark->connector and check it for being NULL.
Also use WRITE_ONCE when writing the mark just to prevent compiler from
doing something stupid.

Reported-by: syzbot+15927486a4f1bfcbaf91@syzkaller.appspotmail.com
Fixes: 77115225ac ("fanotify: cache fsid in fsnotify_mark_connector")
Signed-off-by: Jan Kara <jack@suse.cz>
2019-04-28 22:14:50 +02:00
..
fanotify_user.c fanotify: Allow copying of file handle to userspace 2019-03-19 09:29:07 +01:00
fanotify.c fsnotify: Fix NULL ptr deref in fanotify_get_fsid() 2019-04-28 22:14:50 +02:00
fanotify.h fanotify: Use interruptible wait when waiting for permission events 2019-02-18 12:41:16 +01:00
Kconfig fanotify: Select EXPORTFS 2019-02-14 17:46:33 +01:00
Makefile fanotify: fanotify_init syscall declaration 2010-07-28 09:58:55 -04:00