diff options
| author | Amir Goldstein <amir73il@gmail.com> | 2024-10-11 11:00:23 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2024-11-15 11:34:58 +0100 |
| commit | a20853ab8296d4a8754482cb5e9adde8ab426a25 (patch) | |
| tree | 711948eb7e7ff56240671b86628c6db7acd9e565 /include/linux/exportfs.h | |
| parent | c374196b2b9f4b803fccd59ed82f0712041e21e1 (diff) | |
fs: open_by_handle_at() support for decoding "explicit connectable" file handles
Teach open_by_handle_at(2) about the type format of "explicit connectable"
file handles that were created using the AT_HANDLE_CONNECTABLE flag to
name_to_handle_at(2).
When decoding an "explicit connectable" file handles, name_to_handle_at(2)
should fail if it cannot open a "connected" fd with known path, which is
accessible (to capable user) from mount fd path.
Note that this does not check if the path is accessible to the calling
user, just that it is accessible wrt the mount namesapce, so if there
is no "connected" alias, or if parts of the path are hidden in the
mount namespace, open_by_handle_at(2) will return -ESTALE.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20241011090023.655623-4-amir73il@gmail.com
Fixes: 570df4e9c23f ("ceph: snapshot nfs re-export")
Acked-by:
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/exportfs.h')
| -rw-r--r-- | include/linux/exportfs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 4ee42b2cf4ab..fcab6ab1d38a 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -171,7 +171,7 @@ struct fid { /* Flags supported in encoded handle_type that is exported to user */ #define FILEID_IS_CONNECTABLE 0x10000 #define FILEID_IS_DIR 0x20000 -#define FILEID_VALID_USER_FLAGS (0) +#define FILEID_VALID_USER_FLAGS (FILEID_IS_CONNECTABLE | FILEID_IS_DIR) /** * struct export_operations - for nfsd to communicate with file systems |
