On Wed, May 07, 2025 at 01:16:42PM +0800, Chen Linxuan via B4 Relay wrote: > --- > Documentation/filesystems/fuse-passthrough.rst | 139 +++++++++++++++++++++++++ Add the docs to Documentation/filesystems/index.rst toctree. > +FUSE (Filesystem in Userspace) passthrough is a feature designed to improve the > +performance of FUSE filesystems for I/O operations. Typically, FUSE operations > +involve communication between the kernel and a userspace FUSE daemon, which can > +introduce overhead. Passthrough allows certain operations on a FUSE file to "incur overhead." > +bypass the userspace daemon and be executed directly by the kernel on an > +underlying "backing file". > + > +This is achieved by the FUSE daemon registering a file descriptor (pointing to > +the backing file on a lower filesystem) with the FUSE kernel module. The kernel > +then receives an identifier (`backing_id`) for this registered backing file. (``backing_id``) > +When a FUSE file is subsequently opened, the FUSE daemon can, in its response to > +the ``OPEN`` request, include this ``backing_id`` and set the > +``FOPEN_PASSTHROUGH`` flag. This establishes a direct link for specific > +operations. > <snipped>... > +The ``CAP_SYS_ADMIN`` requirement acts as a safeguard against these issues, > +restricting this powerful capability to trusted processes. As noted in the > +kernel code (``fs/fuse/passthrough.c`` in ``fuse_backing_open()``): I don't see any comments in fuse_backing_open() besides TODO. Perhaps the sentence can be removed? > + > +Discussions suggest that exposing information about these backing files, perhaps > +through a dedicated interface under ``/sys/fs/fuse/connections/``, could be a > +step towards relaxing this capability. This would be analogous to how > +``io_uring`` exposes its "fixed files", which are also visible via ``fdinfo`` > +and accounted under the registering user's ``RLIMIT_NOFILE``. Where are pointers (links) to discussions? These can be added to the docs. > +As a general principle for new kernel features that allow userspace to instruct > +the kernel to perform direct operations on its behalf based on user-provided > +file descriptors, starting with a higher privilege requirement (like > +``CAP_SYS_ADMIN``) is a conservative and common security practice. This allows > +the feature to be used and tested while further security implications are > +evaluated and addressed. As Amir Goldstein mentioned in one of the discussions, > +there was "no proof that this is the only potential security risk" when the > +initial privilege checks were put in place. Discussion links please. Thanks. -- An old man doll... just what I always wanted! - Clara
Attachment:
signature.asc
Description: PGP signature