Bug 290547 - [fusefs]: kernel unconditionally sends FUSE_SETXATTR requests in extended format
Summary: [fusefs]: kernel unconditionally sends FUSE_SETXATTR requests in extended format
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Alan Somers
URL: https://github.com/freebsd/freebsd-sr...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-26 17:44 UTC by Alan Somers
Modified: 2025-11-07 15:46 UTC (History)
0 users

See Also:
asomers: mfc-stable15+
asomers: mfc-stable14-
asomers: mfc-stable13-
asomers: needs_errata-
asomers: exp-run-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2025-10-26 17:44:43 UTC
In FUSE protocols 7.1 through 7.32, the FUSE_SETXATTR request includes an 8-byte header.  Protocol 7.33 optionally extends that to 16 bytes, but only if the server sets FUSE_SETXATTR_EXT in its reply to FUSE_INIT.

Ever since d5e3cf41e89400e75da87aad0cc9bde108e2573b FreeBSD 15.0-CURRENT has used the extended format.  However, it has wrongly used that extended format even if the server does not set FUSE_SETXATTR_EXT.  FreeBSD 14.3 and earlier are unaffected.

This bug only affects file systems that use protocol 7.33 or later, and do _not_ set FUSE_SETXATTR_EXT.  So anything using libfuse is unaffected, as are any Rust-based file systems using the popular fuse3 or fuser crates.  I don't know of any off-the-shelf file systems that are affected.

This issue was originally reported on Github by user CismonX.
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-11-03 17:34:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e8449c0e0fcb8a3eb5872cbee5c3dde4b05a5f50

commit e8449c0e0fcb8a3eb5872cbee5c3dde4b05a5f50
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-10-26 18:06:51 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-11-03 17:14:35 +0000

    fusefs: respect the server's FUSE_SETXATTR_EXT flag

    FUSE protocol 7.33 extended the FUSE_SETXATTR request format.  But the
    extension is optional.  The server must opt-in by setting the
    FUSE_SETXATTR_IN flag during FUSE_INIT.  We were wrongly using the
    extended format for any server using protocol 7.33 or later.

    PR:             290547
    Co-authored-by: CismonX <admin@cismon.net>
    Fixes:          d5e3cf41e89 ("fusefs: Upgrade FUSE protocol to version 7.33")
    MFC after:      3 days

 sys/fs/fuse/fuse_internal.c  |  5 +++-
 sys/fs/fuse/fuse_ipc.h       |  1 +
 sys/fs/fuse/fuse_vnops.c     |  4 +--
 tests/sys/fs/fusefs/xattr.cc | 67 ++++++++++++++++++++++++++++++++++----------
 4 files changed, 59 insertions(+), 18 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-11-06 00:39:35 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a23bd71deaad478cbe41ae756b96ea7a32537311

commit a23bd71deaad478cbe41ae756b96ea7a32537311
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-10-26 18:06:51 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-11-06 00:25:27 +0000

    fusefs: respect the server's FUSE_SETXATTR_EXT flag

    FUSE protocol 7.33 extended the FUSE_SETXATTR request format.  But the
    extension is optional.  The server must opt-in by setting the
    FUSE_SETXATTR_IN flag during FUSE_INIT.  We were wrongly using the
    extended format for any server using protocol 7.33 or later.

    PR:             290547
    Co-authored-by: CismonX <admin@cismon.net>
    Fixes:          d5e3cf41e89 ("fusefs: Upgrade FUSE protocol to version 7.33")
    MFC after:      3 days

    (cherry picked from commit e8449c0e0fcb8a3eb5872cbee5c3dde4b05a5f50)

 sys/fs/fuse/fuse_internal.c  |  5 +++-
 sys/fs/fuse/fuse_ipc.h       |  1 +
 sys/fs/fuse/fuse_vnops.c     |  4 +--
 tests/sys/fs/fusefs/xattr.cc | 67 ++++++++++++++++++++++++++++++++++----------
 4 files changed, 59 insertions(+), 18 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-11-06 23:12:48 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a711949115b589590c19db8489e0a4ab80a6673c

commit a711949115b589590c19db8489e0a4ab80a6673c
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-10-26 18:06:51 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-11-06 23:10:51 +0000

    fusefs: respect the server's FUSE_SETXATTR_EXT flag

    FUSE protocol 7.33 extended the FUSE_SETXATTR request format.  But the
    extension is optional.  The server must opt-in by setting the
    FUSE_SETXATTR_IN flag during FUSE_INIT.  We were wrongly using the
    extended format for any server using protocol 7.33 or later.

    Approved by:    re (cperciva)
    PR:             290547
    Co-authored-by: CismonX <admin@cismon.net>
    Fixes:          d5e3cf41e89 ("fusefs: Upgrade FUSE protocol to version 7.33")
    MFC after:      3 days

    (cherry picked from commit e8449c0e0fcb8a3eb5872cbee5c3dde4b05a5f50)
    (cherry picked from commit a23bd71deaad478cbe41ae756b96ea7a32537311)

 sys/fs/fuse/fuse_internal.c  |  5 +++-
 sys/fs/fuse/fuse_ipc.h       |  1 +
 sys/fs/fuse/fuse_vnops.c     |  4 +--
 tests/sys/fs/fusefs/xattr.cc | 67 ++++++++++++++++++++++++++++++++++----------
 4 files changed, 59 insertions(+), 18 deletions(-)