• Amir Goldstein's avatar
    fanotify: limit reporting of event with non-decodeable file handles · 97ac4897
    Amir Goldstein authored
    Commit a95aef69 ("fanotify: support reporting non-decodeable file
    handles") merged in v6.5-rc1, added the ability to use an fanotify group
    with FAN_REPORT_FID mode to watch filesystems that do not support nfs
    export, but do know how to encode non-decodeable file handles, with the
    newly introduced AT_HANDLE_FID flag.
    
    At the time that this commit was merged, there were no filesystems
    in-tree with those traits.
    
    Commit 16aac5ad ("ovl: support encoding non-decodable file handles"),
    merged in v6.6-rc1, added this trait to overlayfs, thus allowing fanotify
    watching of overlayfs with FAN_REPORT_FID mode.
    
    In retrospect, allowing an fanotify filesystem/mount mark on such
    filesystem in FAN_REPORT_FID mode will result in getting events with
    file handles, without the ability to resolve the filesystem objects from
    those file handles (i.e. no open_by_handle_at() support).
    
    For v6.6, the safer option would be to allow this mode for inode marks
    only, where the caller has the opportunity to use name_to_handle_at() at
    the time of setting the mark. In the future we can revise this decision.
    
    Fixes: a95aef69 ("fanotify: support reporting non-decodeable file handles")
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Message-Id: <20231018100000.2453965-2-amir73il@gmail.com>
    97ac4897
fanotify_user.c 51.9 KB