summaryrefslogtreecommitdiff
path: root/fs/notify/group.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2024-07-17 16:06:23 +0200
committerJan Kara <jack@suse.cz>2024-10-02 15:11:40 +0200
commit35ceae44742e1101f9d20adadbbbd92c05d7d659 (patch)
treef34ed94b97e2467f369d26edc1eaf789aee5bf4f /fs/notify/group.c
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
fsnotify: Avoid data race between fsnotify_recalc_mask() and fsnotify_object_watched()
When __fsnotify_recalc_mask() recomputes the mask on the watched object, the compiler can "optimize" the code to perform partial updates to the mask (including zeroing it at the beginning). Thus places checking the object mask without conn->lock such as fsnotify_object_watched() could see invalid states of the mask. Make sure the mask update is performed by one memory store using WRITE_ONCE(). Reported-by: syzbot+701037856c25b143f1ad@syzkaller.appspotmail.com Reported-by: Dmitry Vyukov <dvyukov@google.com> Link: https://lore.kernel.org/all/CACT4Y+Zk0ohwwwHSD63U2-PQ=UuamXczr1mKBD6xtj2dyYKBvA@mail.gmail.com Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/20240717140623.27768-1-jack@suse.cz
Diffstat (limited to 'fs/notify/group.c')
0 files changed, 0 insertions, 0 deletions