Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'fsnotify_for_v6.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fsnotify fixes from Jan Kara:
"Two fsnotify fixes.

The fix from Ahelenia makes sure we generate event when modifying
inode flags, the fix from Amir disables sending of events from device
inodes to their parent directory as it could concievably create a
usable side channel attack in case of some devices and so far we
aren't aware of anybody depending on the functionality"

* tag 'fsnotify_for_v6.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fs: send fsnotify_xattr()/IN_ATTRIB from vfs_fileattr_set()/chattr(1)
fsnotify: do not generate ACCESS/MODIFY events on child for special files

+10 -1
+2
fs/file_attr.c
··· 2 2 #include <linux/fs.h> 3 3 #include <linux/security.h> 4 4 #include <linux/fscrypt.h> 5 + #include <linux/fsnotify.h> 5 6 #include <linux/fileattr.h> 6 7 #include <linux/export.h> 7 8 #include <linux/syscalls.h> ··· 299 298 err = inode->i_op->fileattr_set(idmap, dentry, fa); 300 299 if (err) 301 300 goto out; 301 + fsnotify_xattr(dentry); 302 302 } 303 303 304 304 out:
+8 -1
fs/notify/fsnotify.c
··· 270 270 /* 271 271 * Include parent/name in notification either if some notification 272 272 * groups require parent info or the parent is interested in this event. 273 + * The parent interest in ACCESS/MODIFY events does not apply to special 274 + * files, where read/write are not on the filesystem of the parent and 275 + * events can provide an undesirable side-channel for information 276 + * exfiltration. 273 277 */ 274 - parent_interested = mask & p_mask & ALL_FSNOTIFY_EVENTS; 278 + parent_interested = mask & p_mask & ALL_FSNOTIFY_EVENTS && 279 + !(data_type == FSNOTIFY_EVENT_PATH && 280 + d_is_special(dentry) && 281 + (mask & (FS_ACCESS | FS_MODIFY))); 275 282 if (parent_needed || parent_interested) { 276 283 /* When notifying parent, child should be passed as data */ 277 284 WARN_ON_ONCE(inode != fsnotify_data_inode(data, data_type));