Skip to content
Commit b1da6a51 authored by Jan Kara's avatar Jan Kara
Browse files

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: default avatar <syzbot+15927486a4f1bfcbaf91@syzkaller.appspotmail.com>
Fixes: 77115225

 ("fanotify: cache fsid in fsnotify_mark_connector")
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent ba25b50d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment