Skip to content

DAOS-19915 build: Update to libfuse 3.18.3 - #12

Merged
mchaarawi merged 311 commits into
masterfrom
mschaara/libfuse-3.18.3
Nov 4, 2026
Merged

mchaarawi merged 311 commits into
masterfrom
mschaara/libfuse-3.18.3

Conversation

@mchaarawi

Copy link
Copy Markdown

No description provided.

dependabot Bot and others added 30 commits March 11, 2025 14:38
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.28.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@9e8d078...6bb031a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
The main goal of this new file is to warn about the deadlocking risks when
using the out-of-band notify operations while replying to other requests.

Signed-off-by: Luis Henriques <luis@igalia.com>
Added PanFSto whitelist. This should allow us to mount gocryptfs onto the parallel filesystem.

Signed-off-by: Jacob Riley <jnr0006@uah.edu>
Some applications use that for detection of features between
distributions/libfuse version.

Closes: libfuse#1163

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
This fixes dynamic buffer allocation in commit
0e0f43b ("Reallocate fuse_session buffer...")

I noticed that when I increased the default fuse buf size as
possible in recent kernels.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
se->buf_reallocable is true when reading /dev/fuse is handled
from internal functions - we can set the variable in
fuse_session_receive_buf_internal(). With that we also
don't need to have it an _Atomic variable anymore.

In _fuse_session_receive_buf() we can use "bool internal"
to check if the buffer can be re-allocated.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Redirect stdin/stdout/stderr to /dev/null to prevent newly opened
file descriptors from reusing these low numbers (0,1,2) and
potential issues with that.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
We have a non ideal configuration for different editors.
The project uses linux style - emacs config should also
correspond to that.

Taken from
https://www.kernel.org/doc/html/v6.13/process/coding-style.html#you-ve-made-a-mess-of-it
with the attempt to update for c++.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Closes: libfuse#1168
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
This is to avoid checkpatch reports and might potentially
avoid future issues if these macros would be part of
conditions.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
The file is going to be updated - should be more conform

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
32-bit conn->want flags been left to be ABI compatible to 3.10,
even though the so version was changed.
The more recent way is to use fuse_set_feature_flag(),
which will use conn->want_ext.

Given that we now have two flags (want and want_ext), we need
to convert and that brought several issues
- If the application sets conn->want, that needs to be set into
  the lower 32 bit of  conn->want_ext. As the application might
  actually unset values, it really has to be a copy and not
  just 'or' - fixed now.
- convert_to_conn_want_ext() actually needs to check for
  _modified_ conn->want and conn->want_ext
- convert_to_conn_want_ext() must consider being called from
  high and lowlevel interfact, with different want_ext_default
  and want_default values. It is only a failure, if the application
  changed both, conn->want and conn->want_ext. This function
  was failing in issue libfuse#1171, because high level fuse_fs_init()
  was changing values and then lowlevel do_init() was incorrectly
  failing on that.

This also adds a new test (test_want_conversion) and sets
values into example/{hello.c,hello_ll.c}

Also some more internal users of conn->want are converted to
fuse_{set,unset}_feature_flag().

Closes: libfuse#1171
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Thes commits have the habit to persistently fail, mostly
with long lines. We don't have control over these commits,
so let's ignore them.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.11 to 3.28.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@6bb031a...1b549b9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
When building and installing FUSE3 using Meson on CentOS8, the fuse3.pc
file is installed in the /usr/local/lib64/pkgconfig directory. However,
pkg-config does not search for fuse3.pc in this directory, leading to GCC
compilation failures.

This patch improves the compilation comments, helping users successfully
execute the GCC command.

Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
When building FUSE3 with Meson on CentOS 8, the fuse3.pc file gets
installed in /usr/local/lib64/pkgconfig. Since pkg-config doesn't search
this path by default, GCC compilation fails due to missing FUSE3 flags.

This patch adds an instruction for setting PKG_CONFIG_PATH variable in
README.compile to fix GCC compilation issues.

Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
Copy over usdt.h from [1] as part of the prepatory work for adding
tracepoints for requests.

[1] https://github.com/libbpf/usdt

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
… replying

Add user statically-defined tracepoints for request lifecycle.

Verified by:
[machine]$ readelf -n /home/libfuse/build/lib/libfuse3.so | grep -A 1000 '.note.stapsdt'
Displaying notes found in: .note.stapsdt
  Owner                Data size        Description
  stapsdt              0x00000035       NT_STAPSDT (SystemTap probe descriptors)
    Provider: libfuse
    Name: request_receive
    Location: 0x0000000000016360, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
    Arguments: -4@%edi
  stapsdt              0x00000055       NT_STAPSDT (SystemTap probe descriptors)
    Provider: libfuse
    Name: request_reply
    Location: 0x0000000000017c0f, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
    Arguments: 8@8(%r12) 4@(%r12) -4@4(%r12) -4@%r13d
  stapsdt              0x0000003e       NT_STAPSDT (SystemTap probe descriptors)
    Provider: libfuse
    Name: request_process
    Location: 0x000000000001acf7, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
    Arguments: 4@%r8d 4@%edx

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Add example bpftrace file for monitoring tracepoints.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
linux/close_range.h is only available since kernel 5.9 and
torvalds/linux@60997c3
resulting in the following build failure:

../util/fusermount.c:40:10: fatal error: linux/close_range.h: No such file or directory

So let's check for header presence and emit HAVE_LINUX_CLOSE_RANGE_H
accordingly and check for it when including <linux/close_range.h> and
calling close_range() instead of checking for close_range() function in
meson and check against HAVE_CLOSE_RANGE.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
At the moment build fails due to lack of static_assert:
https://gitlab.com/jolivain/buildroot/-/jobs/9606292537
this means that the check per date is not enough, so let's use meson to
check if static_assert() is present or not and simplify
fuse_static_assert() definition by only checking HAVE_STATIC_ASSERT.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Default is having usdt disabled.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
These are several buf size fixes

1) Set bufsize when HAVE_SPLICE is not defined. Addresses
libfuse#1184

2) Check in the read retry condition for bufsize, i.e. the value
passed to read and not for the buf->mem_size. Using buf->mem_size
can be startup racy. Additionally we now also set bufsize on
allocation to avoid these races.

3) Allocation and value assigned needs to follow the pattern

bufsize = se->bufsize;
buf_alloc(bufsize, internal)
buf->mem_size = bufsize;

I.e. bufsize has to be retrieved first, as se->bufsize might
change at anytime - the value used for allocation and
must not differ from the value actually used.

This also tries to set large sizes in passthrough_hp, to catch
issues in xfstests - though requires to set
/proc/sys/fs/fuse/max_pages_limit

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@1b549b9...45775bd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Newer gccs now use -Werror=redundant-decls which means that anyone
including fuse.h is getting an error of:

/usr/include/fuse3/fuse.h:959:5: error: redundant redeclaration of ‘fuse_main_real_versioned’ [-Werror=redundant-decls]
  959 | int fuse_main_real_versioned(int argc, char *argv[],
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fuse3/fuse.h:885:5: note: previous declaration of ‘fuse_main_real_versioned’ with type ‘int(int,  char **, const struct fuse_operations *, size_t,  struct libfuse_version *, void *)’ {aka ‘int(int,  char **, const struct fuse_operations *, long unsigned int,  struct libfuse_version *, void *)’}
  885 | int fuse_main_real_versioned(int argc, char *argv[],
      |     ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
For kernel development it might be necessary to load a module with
renamed symbols and renamed /dev/<devicenode>. Reason is that for
example ubuntu kernels have fuse compiled in and it is not possible
to replace it at run time. And fuse might also be used for other file
systems - a different device node is then needed. Also consolidate
device path handling and remove unnecessary string duplication in
mount_fuse() in fusermount.c.

Signed-off-by: Meng Lu Wang <mwang@ddn.com>
The high-level interface triggers flag conversion twice: once in the
high-level init and once in the low-level init. This caused false
"both 'want' and 'want_ext' are set" errors when using
fuse_set_feature_flag() or fuse_unset_feature_flag().

The existing check for duplicate conversion only worked when 32-bit
flags were set directly. When using the preferred flag manipulation
functions, conn->want and the lower 32 bits of conn->want_ext
would differ, triggering the error.

Fix this by synchronizing conn->want with the lower 32 bits of
conn->want_ext after conversion, ensuring consistent state for
subsequent calls.

Closes: libfuse#1171

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Since pthread_setname_np() is the only pthread function that requires NPTL
and it basically only set thread name, let's check if pthread_setname_np()
does exist, otherwise let's not call pthread_setname_np() to shrink
dependencies.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: swj <1186093704@qq.com>
Commit dae1184 ("Add syslog and fatal signal handler feature")
added fuse_set_fail_signal_handlers() which can store
"se". But as fuse_set_signal_handlers() also stores the object
storing it was made conditionally if not set already.

As per libfuse#1182 this
breaks some applications like osspd, that have multiple
sessions and rely on the right order and that the last
call of fuse_set_signal_handlers() wins.

Special thanks to Sébastien Noel to debug this issue.

Closes: libfuse#1182
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
jengelh and others added 26 commits September 5, 2026 22:56
Do not make sentences more complicated than they need to be.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
(cherry picked from commit fa03307)
Signed-off-by: wilkis <marvin@alruno.eu>
(cherry picked from commit 1cb5878)
The previous one 404ed.

Signed-off-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit ff7aa45)
Reported-by: Yaroslav Ibrahimov <51054594+yaroslavibr@users.noreply.github.com>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 173cf15)
Signed-off-by: Ashish Ahuja <shivashish.ahuja@gmail.com>
(cherry picked from commit ba68751)
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit b2852e0)
The sourceforge address in the README is the only contact the project
gives, and the release announcement template mails it too.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 22f3036)
A case that exercises the fusermount3 mountpoint checks needs the kernel
module but never completes a mount, so it must not be gated on a setuid
fusermount3.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 0622998)
Nothing exercised check_perm()'s refusals, so the symlink rule and the
write-access rule could regress silently, and nothing pinned that only the
final path component is protected -- a mountpoint under a symlinked parent
has to keep working.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 7e69009)
Don't know how it can happen, but apparently it can.

Check NULL cmsg to prevent crash.

Reporter is content with that, since it's a stray fuse startup anyway.  If
it happens "for real", then we'll have better diagnostic.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 9d78424)
Replies are not submitted as they are produced: while a queue thread is
in fuse_uring_queue_handle_cqes() (cqe_processing set), each reply only
prepares a COMMIT_AND_FETCH SQE and the per-reply io_uring_submit() is
skipped. The whole batch, plus the eventfd poll re-arm, is flushed by the
next io_uring_submit_and_wait().

Without IORING_SETUP_SUBMIT_ALL the kernel aborts io_submit_sqes() at the
first SQE whose prep fails, leaving the rest of the batch unconsumed until
the following loop iteration -- head-of-line blocking the other in-flight
replies behind one bad commit. Set the flag so the kernel drains the whole
batch and only the failing SQE gets an error CQE.

This might have resulted in fuse-over-io-uring stalls, if applications
were waiting for results and libfuse was waiting for CQEs, but
not all SQEs had been submitted yet.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit a19bb4f)
Over io_uring a ring entry only goes back to the kernel via
COMMIT_AND_FETCH. fuse_reply_none() merely freed the request, so a
FORGET answered this way leaked the entry and left the kernel-side
request outstanding.

Signed-off-by: Robert Doebbelin <robert@quobyte.com>
(cherry picked from commit 758c7aa)
A daemon that dies with io-uring registered leaves the mountpoint returning
ECONNABORTED, not ENOTCONN: the probe open() is queued on a ring the kernel
has not finished tearing down yet, and the teardown ends the request rather
than refusing it. Accepting only ENOTCONN skips the auto-unmount and leaves
the mount behind.

The cherry pick to 3.18 differs in respect to should_auto_unmount(),
because commit a486808 removed the privileged open() from
should_auto_unmount(); only check_ENOTCONN_as_owner() needs
ECONNABORTED.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 60d2180)
This is safer than using umount2() directly, since it does the all the
"fusermount -u" checks.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit ff27278)
struct fuse_file_info reserves padding bits so new flags can be added
without an ABI break, but abidiff reports the resulting member insertion
and padding offset shift as a change and fails the check. Bound the
suppression to size-preserving changes so a real size change still fails.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit a2c34a7)
With FUSE_CAP_HANDLE_KILLPRIV_V2 the kernel stops clearing suid/sgid
itself and leaves that to the filesystem. Clearing them depends on
CAP_FSETID, held by the application that issued the syscall - the
filesystem's own privileges do not matter, and it cannot see the
application's, so the kernel signals the decision per request. Of the
three flags carrying it only FATTR_KILL_SUIDGID made it through, because
FUSE_SET_ATTR_KILL_SUID happens to be the same bit.
FUSE_OPEN_KILL_SUIDGID and FUSE_WRITE_KILL_SUIDGID were dropped, so a
server that negotiated KILLPRIV_V2 never saw the request on O_TRUNC open
and on write, and suid/sgid survived.

Decode both into a new fuse_file_info::kill_suidgid, taken from the
padding bits, in open, create, write and write_buf. Gate it on the
negotiated capability and not on proto_minor: a filesystem that did not
ask for KILLPRIV_V2 must never see fi->kill_suidgid set, and negotiating
KILLPRIV_V2 implies 7.31, so fuse_create_in::open_flags is there to
read.

Added by Bernd:

- fix the comment style for checkpatch
- drop the XXX markers for unhandled open_flags, this patch handles them
- replace the proto_minor guard with the capability check
- drop security.capability from the field's documentation

The cherry pick to 3.18 differs in respect to ChangeLog.rst, because
prepare-3.18.3-rc1 records fuse_file_info::kill_suidgid in the 3.18.3
release notes.

Signed-off-by: Robert Doebbelin <robert@quobyte.com>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit 9895469)
Bump the version and record the backported fixes.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
fuse_session_custom_io() moves the FUSE protocol onto a descriptor
whose peer is not the kernel, and the only writeup of that is an
example. Say what the callbacks owe the session, what a session loses
without a mount, and which request fields reach the handlers with no
bounds check, since a peer that skips those checks crashes the
filesystem process.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit f1df035)
fuse_session_custom_io() puts a peer of the caller's choosing where the
kernel would be, and libfuse parses what arrives trusting that a kernel
has already validated it -- unvalidated lengths and counts reach the
handlers otherwise. No in-tree user asks for that transport but the
hello_ll_uds example, so it is built only where the option is.

The symbols stay exported and refuse at runtime instead of being
compiled out: dropping fuse_session_custom_io@FUSE_3.17 from the
default build would break every binary already linked against it.

The cherry pick to 3.18 differs in respect to the summary() hunk in
meson.build, which is dropped because 3.18 has no configuration summary
block. The ChangeLog entry goes into the Security Fixes section of
3.18.3-rc1 rather than under Unreleased Changes.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit cbd6679)
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Replace the FSEL_FILES macro and explicit char array with a string
literal for hex_map, deriving the file count from sizeof. Use size_t
for loop variables and fix the printf format specifier accordingly.

Signed-off-by: wangrzneu <wangrzneu@gmail.com>
(cherry picked from commit 22d0fcd)
Compilation fails on Ubutu 26.06, we need another backport.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Take upstream libfuse 3.18.3 with the fuse3 -> fused rename. The
fused-only packaging files are kept from master.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
posix_spawn() creates its child with clone(CLONE_VM|CLONE_VFORK). Under valgrind (as used by DAOS NLT) the child never reaches execve(), so fusermount3 is not run and the mount fails. Go back to fork+exec, as fused v1.0.0/v1.1.0 did, keeping the rest of upstream 3.18.3 mount.c unchanged.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
@mchaarawi
mchaarawi requested a review from a team as a code owner November 4, 2026 13:32
@mchaarawi mchaarawi changed the title Mschaara/libfuse 3.18.3 DAOS-19915 build: Update to libfuse 3.18.3 Nov 4, 2026
@mchaarawi
mchaarawi merged commit b5eb902 into master Nov 4, 2026
4 of 19 checks passed
@mchaarawi
mchaarawi deleted the mschaara/libfuse-3.18.3 branch November 4, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.