Amir Goldstein 29044dae2e fsnotify: fix fsnotify hooks in pseudo filesystems
Commit 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of
d_delete()") moved the fsnotify delete hook before d_delete() so fsnotify
will have access to a positive dentry.

This allowed a race where opening the deleted file via cached dentry
is now possible after receiving the IN_DELETE event.

To fix the regression in pseudo filesystems, convert d_delete() calls
to d_drop() (see commit 46c46f8df9aa ("devpts_pty_kill(): don't bother
with d_delete()") and move the fsnotify hook after d_drop().

Add a missing fsnotify_unlink() hook in nfsdfs that was found during
the audit of fsnotify hooks in pseudo filesystems.

Note that the fsnotify hooks in simple_recursive_removal() follow
d_invalidate(), so they require no change.

Link: https://lore.kernel.org/r/20220120215305.282577-2-amir73il@gmail.com
Reported-by: Ivan Delalande <colona@arista.com>
Link: https://lore.kernel.org/linux-fsdevel/YeNyzoDM5hP5LtGW@visor/
Fixes: 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of d_delete()")
Cc: stable@vger.kernel.org # v5.3+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
2022-01-24 14:17:02 +01:00
..
2021-12-03 18:44:06 +01:00
2021-01-25 09:36:28 -05:00
2021-10-02 15:51:10 -04:00
2021-10-02 15:51:10 -04:00
2020-09-25 18:01:26 -04:00
2022-01-08 14:42:02 -05:00
2022-01-16 07:42:58 +02:00
2021-01-24 14:27:17 +01:00
2021-10-02 15:51:10 -04:00
2022-01-16 07:42:58 +02:00
2021-12-13 13:42:51 -05:00
2021-12-13 13:42:51 -05:00
2022-01-08 14:42:03 -05:00
2018-09-25 20:34:54 -04:00