Repository navigation
fix: pin the destination and ACL apply, admit getgroups in the daemon filter - #8201
Merged
Merged
Conversation
A non-root daemon worker decides whether it may set a file group from metadata::group_is_settable, which mirrors upstream is_in_group() (uidlist.c:195-239) and lists the process groups with getgroups(2). The worker allowlist omitted getgroups, so under the daemon-seccomp feature the call failed with EPERM, every supplementary group read as foreign, and each such chown was skipped while the transfer exited 0. UTS daemon-groupmap-wild over TCP failed this way with --all-features. Admit SYS_getgroups (the only number on x86_64 and aarch64). A failing getgroups still falls back to the effective gid as upstream does, but is now reported once on stderr instead of passing silently.
Mirror upstream 3.5.1 usage.c:110-125: a Linux build with ACL support prints ACL-at or no ACL-at after ACLs. The value comes from metadata::ACL_APPLY_IS_FD_PINNED, which records that the receiver applies ACLs by path, so oc reports no ACL-at. End the checksum and compress lists with none, as upstream get_default_nno_list() does with a dup markup (compat.c:477-478), in both the text and JSON reports. This replaces two tests that asserted the lists exclude none, which the 3.5.1 binary contradicts. Add a golden test of the Capabilities and Optimizations text, derived from upstream print_info_flags() wrap loop.
…on root The network receiver and the local copy now write ACLs the way the xattr half already does: through an O_NOFOLLOW fd pinned beneath the destination root, serialised into the kernel system.posix_acl_* format (lib/acl.c acl_to_xattr). A refused pin on a slashed path skips the ACL (rsync.c:597 xattr_refuse). Like upstream (rsync.c:563-571) only regular files, directories and FIFOs are opened; devices and sockets are written through the confined parent dirfd via /proc/self/fd (lib/acl.c xacl_set_at). --version reports ACL-at on Linux ACL builds.
Pack the -VV capability and optimization objects with the same 75-byte line buffer as the text report (usage.c:189-238): one loop now serves both, entries are filled to the line width, and each object closes with " }" on its own line. Wrap the warranty footer to upstream's three lines (usage.c:336-339), with two spaces after each full stop and the "Licence" spelling, while keeping this binary's program name. Extend the golden tests with the JSON objects and the footer, derived from the same reproduction of upstream's wrap loop.
…security-bundle-cves
…x/security-bundle-cves # Conflicts: # README.md
The receiver's special-file pass set the mode, owner and times on a FIFO, socket or device node but never applied its ACL. Upstream's set_file_attrs() calls set_acl() for every non-symlink entry (rsync.c:800), holding a FIFO open O_NONBLOCK and addressing a device or socket through its parent (rsync.c:563-571, acls.c:1315-1321). Thread the ACL cache and id map into create_specials and apply the ACL beneath the destination root, so the acl-symlink-race positive control holds. The dir and leaf fields of DestPin::Parent are read only by the Linux fd-pinned ACL apply, so they are now compiled only there; other targets and builds without the acl feature failed with dead_code under -D warnings. Also reformat backups.rs, which cargo fmt cannot reach.
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This bundles three security fixes.
CVE-2026-53796: pin the operator-named destination (Partially fixed)
A receiver that is not a daemon (local copy, the pull client,
--serverover rsh) now walks the destination path checking symlink owners, mirroring upstreamchange_dir()'sopen_no_attacker_symlinks_dirfd()in util1.c. A symlink owned by another uid is refused with exit 3. The fd the walk returns becomes the pinned destination root, so later opens of the destination reuse it instead of resolving the path again; a swap of the path after the walk is refused with ELOOP. The daemon path is unchanged. On Windows this code is not compiled.It stays Partially fixed, because upstream
fchdir()s into the pinned directory and oc has not reached that end state:CVE-2026-53799, ACL half: apply ACLs through a pinned leaf (Fixed, upstream parity on supported platforms)
On Linux, ACLs are now written through a leaf pinned beneath the destination root, using the kernel's
system.posix_acl_*xattr format. The encoding is byte-identical to upstream lib/acl.c:120-153, and a golden test checks it.O_NONBLOCK|O_NOFOLLOW|O_NOCTTY, as in rsync.c:563-571. Before this change oc also opened device nodes./proc/self/fd, falling back to the path when/procis unavailable (acls.c:1315-1321).--versionnow reportsACL-aton Linux ACL builds and lists thenoneentries. Its JSON and footer are laid out like upstream 3.5.1 (usage.c:189-238, 336-339).ACLs on special files (receiver)
The receiver's special-file pass (
create_specials_in_range) set mode, owner and times on FIFOs, sockets and devices, but never their ACL. Upstream applies ACLs to them throughset_file_attrs->set_acl(rsync.c:800). The pass now applies the ACL after the other metadata, in all five receiver drivers, and reports failures as FERROR_XFER.acl-symlink-racecell exits early unless--versionreportsACL-at, so it passed without testing anything. WithACL-atnow reported, the cell's positive control runs, and it passes only with this fix (nonroot pipe, root pipe and nonroot TCP legs).receiver_applies_the_acl_to_a_fifo_entry. Removing the new apply block makes it fail.Daemon seccomp: admit
getgroupsThe daemon worker's seccomp allowlist did not include
getgroups. As a result,process_in_group()returned false and a chown to a supplementary group was silently skipped.Validation
All runs are on Linux aarch64, on the merged tree:
-D warningsis clean for cli, core, daemon, engine, fast_io, metadata, transfer and bin, with default features and with--all-features.version::(core)getgroupsfrom the allowlist fails it in both runs.--insecure-linksexits 23; the local swap race writes outside the destination. All three pass on the fix. Three mutations each turn tests red: bypassing the owner check, re-opening the destination by path, and dropping the receiver sandbox.ACL-atforced to false.cargo xtask no-placeholdersand the citation ratchet both pass.no_implied_dirs_follows_an_existing_dest_symlink_path_element(ELOOP), fails the same way on untouched master on the same machine. Master CI passes it, so the failure looks specific to that machine.Docs
SECURITY.md, docs/audits/cve-uts351-matrix.md (including the Totals table), README and CHANGELOG are updated. The counts are now 27 fixed, 1 partially fixed (53796) and 5 not applicable.
The version golden test helpers now have the same cfg gate as the tests that use them; on Windows they were dead code.