Repository navigation
sacdfs 0.6.4
A security release: 0.6.3 plus fixes for three advisories, and the hardening of the installer,
the container and the systemd unit. Audio bytes are unchanged from 0.6.3. The pacing changes on
main since 0.6.3 (#363, #362) are not in it; they come in 0.6.5. The gate results are in
docs/test-plan.md ("Results: 0.6.4 gate").
Security
- Open files: a client of the mount could make images disappear from their folders
(GHSA-phfg-58h9-f2pp, High).
Upgrade to 0.6.4. - Installer and
sacdfs-ctl: files that other users could change were run as root
(GHSA-wfjg-pqhm-4mm2, High).
Upgrade to 0.6.4, and on QNAP, or wherever sacdfs's folder is inside a shared folder, run the
installer again (see "Upgrading" below). - Tags, cache and report files were written and read unsafely
(GHSA-825f-7xrc-fqf7, Medium).
Upgrade to 0.6.4.
Upgrading
- Installs made with the installer: run it again as you first did. On QNAP, and wherever
sacdfs's folder was inside a shared folder, it moves sacdfs's files to a folder only root can
change (on QNAP/share/CACHEDEV1_DATA/.sacdfs, with the DSF and WAV files in
/share/CACHEDEV1_DATA/sacd) and removes the old copy; then share the newsacdfolder and
point your players at it. By hand: where the files go
and the QNAP guide. - Docker, Podman, TrueNAS, Unraid: take the image
ghcr.io/aclater/sacdfs:0.6.4, and for least
privilege the newcap_drop,cap_addandsecurity_optlines from
deploy/nas-compose.yaml (or thedocker runoptions in
docs/deployment.md). An older Compose file keeps working, with
the per-program limits applied inside the container. - systemd: copy the new
sacdfs.servicefrom the release archive; a systemd too old for an
option logsUnknown lvalueand runs the unit without it. sacdfs tags importexits with status 2 when it left out a picture or value the mount
would not use (listed asnot kept:); scripts that delete extracts after an import should
keep those extracts.
Added
- The installer stops on a system it can't support before it downloads anything, and prints
the details to ask for it (#382). Before, the container route never checked the processor
(on i686 or 32-bit ARM it pulled an image that can't run), a 64-bit kernel with 32-bit
programs (Raspberry Pi OS 32-bit on a Pi 4 or 5) got the aarch64 build, and an old glibc or
musl was only found when the downloaded binary failed to start. Now the processor and the
programs' word size are checked for every route, and glibc 2.17 or later (not musl) for the
binary routes, before the root check and any download; FUSE is checked before the download
too. On those stops, a missing FUSE,--method composewith no engine, and a binary that
doesn't start after all, it prints a short block (installer version, the check, processor,
memory, OS and NAS version, kernel, C library, FUSE, systemd, container engine; no host name,
address, serial number, user name or folder) and a link to the unsupported system form. A Mac
or Windows PC still gets the "Linux only" message, with no block.install.sh --reportprints
the block on any Linux system, as a normal user, and changes nothing, for beta test reports. - sacdfs raises its open files limit to the hard limit at start and logs a warning when that
limit is below 4096;--max-open-imagesis kept under half of it. - A fuzz target for the audio read path (#390).
fuzz/fuzz_targets/read_path.rsreads
the DSF and WAV files of damaged corpus images (plain DSD and DST, 2048-, 2054- and 2064-byte
sectors) at any offset and length, with read-ahead and small caches whose buffers are reused
across images, and checks each read against a reader with no cache. It runs in the fuzz job
with the other targets, from seeds made byexamples/fuzz_seeds.rs. Locally it ran for the
hours in its pull request, with no finding.
Changed
-
The systemd unit limits what sacdfs may do, and the mount stays visible (#387). The unit in
the release archive now keeps sacdfs to the rights to mount and to read the images
(CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE). It also sets:- no new privileges;
- no device but
/dev/fuse; - sockets for the journal and MusicBrainz only;
- a system call deny list;
- native calls only;
- no namespaces, realtime scheduling, setuid files, writable-and-executable memory, clock
or hostname changes.
Options that give the service its own mount namespace (
ProtectSystem=,PrivateTmp=and the
like) stay out, because the mount would then be seen by no other program; the unit's comments
and docs/deployment.md say why each was kept or left out.
systemd-analyze securitygoes from 9.6 to 4.1. A systemd too old for an option logs
Unknown lvalueand runs the unit without it. Checked on Fedora 44, RHEL 10.1, TerraMaster
TOS 7.0, Debian 12 with UGREEN's kernel and ReadyNAS OS 6.10 (systemd 230), each in a VM, not on
the vendor's hardware. -
The image upgrades Fedora's own packages when it is built, and a weekly scan checks the
published image (#399). The runtime stage starts from the digest-pinned Fedora 44 base as
before, then runsdnf upgradebefore it installs Samba and the rest, so the base's packages
get Fedora 44's updates too. A scan of the 0.6.3 image with grype found 39 known
vulnerabilities, all fixed in Fedora 44 updates: 16 High in pcre2 and 23 Medium in dnf5,
libgcc, libstdc++, libgomp, libmodulemd and tpm2-tss. None were in Samba, NFS-Ganesha or fuse3.
An image built with the upgrade has none. The image is about 35 MB larger uncompressed (the
upgraded files sit on top of the pinned base layer). A new workflow,image-scan.yml, scans the
latest published image every week, and on demand, and fails on High or Critical findings that
have a fix. -
The container gives each program only the capabilities it needs (#386). The Compose files,
the TrueNAS app and the Unraid template now drop the runtime's whole default set
(cap_drop: ALL) and add back seven:SYS_ADMIN,DAC_OVERRIDE,DAC_READ_SEARCH,SETUID,
SETGID,NET_BIND_SERVICEandSETPCAP, withno-new-privileges. Inside, the entry point
starts each program withsetprivand a reduced bounding set: sacdfs keepsSYS_ADMINand
DAC_OVERRIDE, smbdSETUID,SETGIDandNET_BIND_SERVICE, and NFS-Ganesha
DAC_READ_SEARCHalone; neither server can mount, and only NFS-Ganesha can open files by
handle. At its start the entry point also drops whatever none of them need, so a container
started with an older Compose file holds no more either, and withNFS=0no process keeps
DAC_READ_SEARCH. Every capability in the list was checked to be needed by leaving it out.
Checked with the CI share test (Docker and rootful Podman, AppArmor) and on Fedora 44 in a VM
with SELinux enforcing (Docker, rootful and rootless Podman, both Compose tools); copying the
corpus over SMB and NFS took as long as before. To upgrade: take the newcap_drop,
cap_addandsecurity_optlines from deploy/nas-compose.yaml, or
thedocker runoptions in docs/deployment.md. An older file
keeps working, with the per-program limits applied. Under SELinux, the container mounts with
its normal label: docs/deployment.md lists the labels it can
read the images under. -
Open files are bounded. The sidecar files open at once are capped below the open files
limit (8 to 4096); an open past the cap fails withEMFILEfor that client alone, logged at most
once a minute. A folder listing that left out an image for a passing reason (no descriptors or
memory left,EIO) is made again after a wait (1 s, doubling to 60 s) and isn't kept by the
kernel meanwhile; an image whose opens fail withEIOthree times in a row is left out until
its file changes. Images are opened only if they are regular files. -
Where the installer puts sacdfs, and how it is checked. On QNAP sacdfs's files now live in
/share/CACHEDEV1_DATA/.sacdfs, outside every shared folder; the installer refuses a
--prefixor--mountthat other users can change, and folder names with characters other
than letters, digits, spaces and. _ - + , @ = & ( ) [ ].sacdfs-ctlreads its settings
file as data, not shell code (older files still work), and as root refuses a settings file,
program or folder that other users can change. Each release'sinstall.shcarries the
checksums of its archives;curlis used HTTPS-only. On Synology the Task Scheduler tasks are
found by name. -
Tags, state and report files are written through a new temporary file created exclusively,
then renamed into place; they are read without following a symbolic link and with a size
bound, keep the umask's mode, and a parse error says where in the file it is. Paths and messages on the
terminal, in the log and insacdfs verify's report have control characters escaped, the
frame keys in the summaries ofverifyandtags importeach on their own, and a report row
lists at most 32 other frame keys of at most 128 characters each, then "+N more". -
Names in the daemon's log lines can't split or disguise a line (#391). Image paths, folder
names, disc text and error causes were logged as they were, so a name with a newline split a
line in two, an escape sequence changed how a terminal showed the rest, and a bidi control made
a line display in another order. Now every log line escapes control characters, Unicode format
characters and U+2028/U+2029 as\n,\t,\ror\u{…}, on the console and with
--log-file. The names on the mount are unchanged. -
sacdfs tags importwrites only what the mount uses, and lists what it leaves out (#406).
Before, it wrote any picture and value an extract's tag held, up to 16 MiB, and reported
success, but the mount embeds no picture over 960 KiB and builds no tag over 1 MiB: a 12 MiB
cover or a 3 MiB text field was in the tags directory but never served, and one oversized value
could leave a track's whole tags file unused. Deleting the extract then lost them. Now import
skips a picture over 960 KiB, and per track a value over 16 KiB, keys past 64 and text past
32 KiB, and stops at about 2 MiB of text per disc; a tags file there already is not grown
past 3 MiB. Each is listed asnot kept:with its extract and disc (at most 32 lines, then a
count), and the exit status is 2, so those extracts are kept. -
A release is published only from a tag on
mainor on arelease/X.Y.Zbranch. The release
workflow fetches those branches and stops before building anything when the tagged commit is on
none of them.
Fixed
- A WAV read whose conversion fails is an I/O error, never old audio (#388). If the DSD to
PCM conversion ever refused a run, the engine's buffer (which may be a reused slot of the frame
cache that held another frame's audio) was served and cached as if converted. Now the read fails
withEIO, and nothing of it is cached. In the library,
pcm::Converter::convertandconvert_runfill the output with zeros on failure, and the new
try_convertandtry_convert_runreturn the error. No failure has been seen; the conversion
can't fail with the lengths sacdfs gives it. - A panic in a request answered on fuser's own threads fails that request, not the mount
(#389). Lookups, attributes, listings,statfsand the start of opens and reads are answered
on fuser's threads, which catch no panic: one would have ended the session and taken the mount
down for every client. Each FUSE callback now runs undercatch_unwind: a panic answers that
request withEIO, logs an error line, and the mount keeps serving, as the request threads
already did. No such panic has been seen. verifyandtags importno longer hang on a FIFO in place of a track file (#404). A
.dsfor.dffswapped for a FIFO after the folder was listed held the open forever, waiting
for a writer. Extracts are now opened without blocking and refused unless they are regular
files; that file is reported and the run goes on.
Downloads
Linux binaries, glibc 2.17 or later (RHEL 7 era and later), needing FUSE and, as a user other than root, FUSE 3's fusermount3 (package fuse3) or FUSE 2's fusermount; root needs neither:
sacdfs-0.6.4-x86_64-linux.tar.gz: generic x86-64, for any x86_64 CPU.sacdfs-0.6.4-x86_64-v3-linux.tar.gz: x86-64-v3 (AVX2, most Intel and AMD CPUs since about 2015): about 20 % less CPU for WAV files. It stops with an illegal-instruction error on older CPUs.sacdfs-0.6.4-aarch64-linux.tar.gz: aarch64 (64-bit ARM).
Container image for a NAS (SMB and NFS): ghcr.io/aclater/sacdfs:0.6.4 (generic CPU; amd64 and arm64).
Installer: install.sh finds the system (a NAS or Linux computer) and sets sacdfs up (install guide). Over SSH:
curl -fsSL https://github.com/aclater/sacdfs/releases/latest/download/install.sh \
| sudo sh -s -- --iso-dir /path/to/imagesVerify a download: sha256sum -c <asset>.sha256 and gh attestation verify <asset> -R aclater/sacdfs; the image: gh attestation verify oci://ghcr.io/aclater/sacdfs:0.6.4 -R aclater/sacdfs. See the README, "Install".
Built from d91643e.