summaryrefslogtreecommitdiffstats
path: root/fs/autofs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2025-01-05 17:24:04 +0100
committerChristian Brauner <brauner@kernel.org>2025-01-06 15:43:55 +0100
commitc45beebfde34aa71afbc48b2c54cdda623515037 (patch)
tree40f72d42cb6e55796b824b50ca81f668948921cd /fs/autofs
parentovl: pass realinode to ovl_encode_real_fh() instead of realdentry (diff)
downloadlinux-c45beebfde34aa71afbc48b2c54cdda623515037.tar.xz
linux-c45beebfde34aa71afbc48b2c54cdda623515037.zip
ovl: support encoding fid from inode with no alias
Dmitry Safonov reported that a WARN_ON() assertion can be trigered by userspace when calling inotify_show_fdinfo() for an overlayfs watched inode, whose dentry aliases were discarded with drop_caches. The WARN_ON() assertion in inotify_show_fdinfo() was removed, because it is possible for encoding file handle to fail for other reason, but the impact of failing to encode an overlayfs file handle goes beyond this assertion. As shown in the LTP test case mentioned in the link below, failure to encode an overlayfs file handle from a non-aliased inode also leads to failure to report an fid with FAN_DELETE_SELF fanotify events. As Dmitry notes in his analyzis of the problem, ovl_encode_fh() fails if it cannot find an alias for the inode, but this failure can be fixed. ovl_encode_fh() seldom uses the alias and in the case of non-decodable file handles, as is often the case with fanotify fid info, ovl_encode_fh() never needs to use the alias to encode a file handle. Defer finding an alias until it is actually needed so ovl_encode_fh() will not fail in the common case of FAN_DELETE_SELF fanotify events. Fixes: 16aac5ad1fa9 ("ovl: support encoding non-decodable file handles") Reported-by: Dmitry Safonov <dima@arista.com> Closes: https://lore.kernel.org/linux-fsdevel/CAOQ4uxiie81voLZZi2zXS1BziXZCM24nXqPAxbu8kxXCUWdwOg@mail.gmail.com/ Signed-off-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/r/20250105162404.357058-3-amir73il@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/autofs')
0 files changed, 0 insertions, 0 deletions