Mirror the fuse-side change commit abdd45f83c
("Make ioctl prototype conditional on FUSE_USE_VERSION. (#482)")'
for cuse too.
Crank versions to 3.19 as this is an ABI change.
Also increase the default FUSE_USE_VERSION to 30 in
include/cuse_lowlevel.h, 29 was below the libfuse3
min version.
Closes: https://github.com/libfuse/libfuse/issues/1406
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
As discussed on https://github.com/libfuse/libfuse/issues/1515, libfuse has
a very light dependency on libnuma, only using very light wrappers over
mmap, mbind, and munmap. Remove the libnuma dependency by calling those
syscalls directly.
Populate memory after mmap to avoid SIGBUS later.
Signed-off-by: Benjamin Peterson <benjamin@python.org>
I disagree with this style annotation - just takes another line
without gaining much.
WARNING:LINE_SPACING: Missing a blank line after declarations
+ int ret = access_executable(test_path);
+ if (ret == 0)
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Create a simple fuse server that can be run as a systemd service.
I plan to create some more single-file fuse server examples, so most of
the boilerplate code goes in a separate file.
Also suppress COMPLEX_MACRO in checkpatch, FUSE_OPT_KEY
macros have to stay as they are and checkpatch annotations
are not correct here.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Create a mount helper program that can start a fuse server that runs as
a socket-based systemd service, and a new libfuse module to wrap all the
details of communicating between the mount helper and the containerized
fuse server.
This enables untrusted ext4 mounts via systemd service containers, which
avoids the problem of malicious filesystems compromising the integrity
of the running kernel through memory corruption.
In theory this could also be supported via inetd and clones, though the
author hasn't found one that supports AF_UNIX sockets.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
checkpatch.pl is a kernel copy and the strcpy warning is not valid
for libfuse.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Replace the standalone infer.yml workflow with an infer-codechecker
job in the existing codechecker.yml, consistent with how GCC and
cppcheck analyzers are already integrated.
Changes:
- Add --infer flag to codechecker.sh with run_codechecker_infer()
- Add infer-codechecker job to codechecker.yml
- Simplify install_infer() to only download the binary (build deps
are provided by --codechecker)
- Remove standalone infer.yml and infer-suppressions.txt
This lets developers reproduce Infer issues locally via:
./codechecker.sh --infer --codechecker --build-dir builddir
Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
Disable three cppcheck rules in the CodeChecker CI workflow that generate
too many false positives:
1. cppcheck-constParameterCallback (7 false positives)
- Flags callback functions that must match specific API signatures
- Adding const would break compatibility or require unsafe casts
2. cppcheck-knownConditionTrueFalse (2 false positives)
- Reports threading code conditions as always true/false
- Conditions are modified by other threads during pthread_cond_wait
3. cppcheck-unusedStructMember (1 false positive)
- Reports struct members as unused when only used in conditional builds
- Example: node_slab::used is used when FUSE_NODE_SLAB is defined
These rules are disabled in .github/workflows/codechecker.sh to allow the
CI to pass while still catching real issues with other cppcheck rules.
Result: CI now passes with zero cppcheck issues reported.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Add const qualifiers to various function parameters and local variables:
- Add const to opts parameter in fuse_apply_conn_info_opts (helper.c)
- Add const to config parameter in fuse_loop_cfg_verify (fuse_loop_mt.c)
- Add const to v1_conf parameter in fuse_loop_cfg_convert (fuse_loop_mt.c)
- Add const to f parameter in fuse_mount and fuse_unmount (fuse.c)
- Add const to conflict variable in fuse_lib_getlk (fuse.c)
- Add const to payload, arg, in_buf variables in fuse_lowlevel.c
- Add const to req parameter in find_interrupted (fuse_lowlevel.c)
- Add const to in parameter in fuse_session_in2req (fuse_lowlevel.c)
- Add const to se parameter in fuse_req_check_allow_root (fuse_lowlevel.c)
- Add const to version parameter in fuse_session_new_versioned
(fuse_lowlevel.c)
- Add const to se parameter in fuse_session_fd (fuse_lowlevel.c)
Fixes cppcheck warnings:
- cppcheck-constParameterPointer (12 instances)
- cppcheck-constVariablePointer (5 instances)
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Move the ABI check functionality from the GitHub workflow to a standalone
script at .github/workflows/abicheck.sh. This makes the ABI check reusable
and easier to run locally during development.
The script:
- Auto-detects the previous release tag using find_previous_release_tag.sh
- Supports manual tag specification via --prev-tag
- Creates temporary checkouts for comparison
- Runs abidiff with appropriate suppressions for false positives
Added abidiff_suppressions.abignore to suppress ABI-compatible changes:
- const qualifier additions (source-level only, ABI compatible)
- fuse_session size changes (pre-existing in branch)
- fuse_conn_info and fuse_operations changes (backward compatible)
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Add const to various function parameters and local variables:
- Add const to path_element and node in fuse_reverse_inodepath
- Add const to end parameter in unlock_path
- Add const to f parameter in fuse_prepare_interrupt
- Add const to fi parameter in file_info_string
- Rename local buf to fi_str to avoid shadowing outer argument
- Add const to node in is_open
- Reduce scope and add const to node/newnode in hidden_name
- Reduce scope of err in fuse_create_context_key
- Remove redundant err=0 and !err check in fuse_lib_setattr
- Add const to st parameter in fuse_add_direntry_to_dh
- Add const to node in lookup_nodeid
- Reduce scope of res in fuse_lib_fill_dir_plus
- Add const to llfi parameter in fuse_readdir_common
- Add const to lock parameter in lock_to_flock
- Reduce scope of node in fuse_clean_cache
- Add const to f parameter in fuse_get_session
- Reduce scope of sleep_time in fuse_prune_nodes
Note: Skipped callback const warnings that would require function
pointer casts.
Note: Skipped unusedStructMember (used in FUSE_NODE_SLAB build).
Note: Skipped knownConditionTrueFalse (correct threading code).
Note: Skipped uninitStructMember (false positive).
Fixes cppcheck warnings:
- cppcheck-constParameterPointer (7 instances)
- cppcheck-constVariablePointer (5 instances)
- cppcheck-knownConditionTrueFalse
- cppcheck-shadowArgument
- cppcheck-variableScope (4 instances)
- cppcheck-unreadVariable
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Security and quality always complains about a missing report,
probably because there was python before - add it back.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Replace mutable version tags with immutable commit hashes to prevent
tag tampering and supply chain attacks. This ensures that the exact
reviewed code version is executed in CI workflows.
- actions/setup-python@v6 → a309ff8b426b58ec0e2a45f0f869d46889d02405
- actions/checkout@v6.0.2 → de0fac2e4500dabe0009e67214ff5f5447ce83dd
- vmactions/freebsd-vm@v1 → 7ca82f79fe3078fecded6d3a2bff094995447bbd
Also updated python-version to '3.x' for better flexibility.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
New script is .github/workflows/codechecker.sh, which will be
added to a new github action check in a later commit
Also move all workflow dependencies to
.github/workflows/install-ubuntu-dependencies.sh
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
We get too much code yml installation code dup with these
dependencies - let the actions use a common dependency script.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
For development it is expected that the current version doesn't have
a tag yet.
bernd@e7270 libfuse.git>.github/workflows/find_previous_release_tag.sh
Current version: 3.19.0-rc0
Current major.minor: 3.19
All major.minor versions found:
2.9
...
3.17
3.18
Error: No previous major.minor version found before 3.19
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
The 3.18.0 ABI issue came up as we didn't have an ABI
check to the last previous release.
The supressions file needs to compare to the previous version
is also used for the existing ABI check - will reduce false
positives.
This will fail ABI checks against libfuse-3.18.0, as some
symbols in 3.18.0 were marked as the wrong version.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>