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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull fanotify fix from Jan Kara:
"Disable superblock / mount marks for filesystems that can encode file
handles but not open them (currently only overlayfs).

It is not clear the functionality is useful in any way so let's better
disable it before someone comes up with some creative misuse"

* tag 'fsnotify_for_v6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fanotify: limit reporting of event with non-decodeable file handles

+17 -8
+17 -8
fs/notify/fanotify/fanotify_user.c
··· 1585 1585 } 1586 1586 1587 1587 /* Check if filesystem can encode a unique fid */ 1588 - static int fanotify_test_fid(struct dentry *dentry) 1588 + static int fanotify_test_fid(struct dentry *dentry, unsigned int flags) 1589 1589 { 1590 + unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; 1591 + const struct export_operations *nop = dentry->d_sb->s_export_op; 1592 + 1590 1593 /* 1591 - * We need to make sure that the file system supports at least 1592 - * encoding a file handle so user can use name_to_handle_at() to 1593 - * compare fid returned with event to the file handle of watched 1594 - * objects. However, even the relaxed AT_HANDLE_FID flag requires 1595 - * at least empty export_operations for ecoding unique file ids. 1594 + * We need to make sure that the filesystem supports encoding of 1595 + * file handles so user can use name_to_handle_at() to compare fids 1596 + * reported with events to the file handle of watched objects. 1596 1597 */ 1597 - if (!dentry->d_sb->s_export_op) 1598 + if (!nop) 1599 + return -EOPNOTSUPP; 1600 + 1601 + /* 1602 + * For sb/mount mark, we also need to make sure that the filesystem 1603 + * supports decoding file handles, so user has a way to map back the 1604 + * reported fids to filesystem objects. 1605 + */ 1606 + if (mark_type != FAN_MARK_INODE && !nop->fh_to_dentry) 1598 1607 return -EOPNOTSUPP; 1599 1608 1600 1609 return 0; ··· 1821 1812 if (ret) 1822 1813 goto path_put_and_out; 1823 1814 1824 - ret = fanotify_test_fid(path.dentry); 1815 + ret = fanotify_test_fid(path.dentry, flags); 1825 1816 if (ret) 1826 1817 goto path_put_and_out; 1827 1818