Skip to content

Commit b6509f6

Browse files
gormanmtorvalds
authored andcommitted
Revert "fs: Do not check if there is a fsnotify watcher on pseudo inodes"
This reverts commit e9c15ba ("fs: Do not check if there is a fsnotify watcher on pseudo inodes"). The commit intended to eliminate fsnotify-related overhead for pseudo inodes but it is broken in concept. inotify can receive events of pipe files under /proc/X/fd and chromium relies on close and open events for sandboxing. Maxim Levitsky reported the following Chromium starts as a white rectangle, shows few white rectangles that resemble its notifications and then crashes. The stdout output from chromium: [mlevitsk@starship ~]$chromium-freeworld mesa: for the --simplifycfg-sink-common option: may only occur zero or one times! mesa: for the --global-isel-abort option: may only occur zero or one times! [3379:3379:0628/135151.440930:ERROR:browser_switcher_service.cc(238)] XXX Init() ../../sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0072 Received signal 11 SEGV_MAPERR 0000004a9048 Crashes are not universal but even if chromium does not crash, it certainly does not work properly. While filtering just modify and access might be safe, the benefit is not worth the risk hence the revert. Reported-by: Maxim Levitsky <[email protected]> Fixes: e9c15ba ("fs: Do not check if there is a fsnotify watcher on pseudo inodes") Signed-off-by: Mel Gorman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9ebcfad commit b6509f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/file_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ struct file *alloc_file_pseudo(struct inode *inode, struct vfsmount *mnt,
230230
d_set_d_op(path.dentry, &anon_ops);
231231
path.mnt = mntget(mnt);
232232
d_instantiate(path.dentry, inode);
233-
file = alloc_file(&path, flags | FMODE_NONOTIFY, fops);
233+
file = alloc_file(&path, flags, fops);
234234
if (IS_ERR(file)) {
235235
ihold(inode);
236236
path_put(&path);

0 commit comments

Comments
 (0)