v1.0.6
Feature: mkcomposefs --from-file fuzzing
A while ago while working on the Rust composefs bindings I found a bug in the dumpfile parser where the process would crash if provided an unexpected value.
Today for the Rust bindings and the containers/image library because we're forking off a separate process (that we can apply isolation to and low privilege overall) even an assertion failure is relatively benign. And such tools usually wouldn't produce a dumpfile malformed in that way. But still, it caused me to question whether there were other bugs.
For codebases that are linking in the libcomposefs library, process aborts are obviously more problematic.
This series is the result of running honggfuzz and quite a lot of time spent learning this codebase.
Thanks to @hsiangkao @alexlarsson @jeckersb @giuseppe @allisonkarlitskaya
for their assistance with reviews and discussion of this!
Composefs and security
I don't think there's cause to classify this as a CVE yet, as we didn't really formally declare that mkcomposefs --from-file
is a "security boundary". At the current time, if you are using composefs in a context where it is being provided potentially malicious input, it is strongly recommended to ensure that the input is validated and sanitized as much as possible, alongside use of hardening and fuzzing techniques. We have developed Rust bindings for example which do some of this, and work will continue on that.
This said, we will likely aim to make "mkcomposefs --from-file" a security boundary in the future (e.g. guaranteeing that it will always either return an error or generate a valid EROFS) and allocate CVEs for any further flaws.
Composefs and reliability
composefs has been used reliably in many cases for a while now; in general almost all of these issues could only occur for extreme boundary conditions such as:
- symlinks close to the PATH_MAX (4096 byte) limit
- extremely large extended attributes
- Files claiming to be extremely large (> 5 EiB)
Hence, I do not think there is a need for existing composefs users to consider this a critical fix.
Most of these cases also again would fail with an assertion - at most a denial of service. However in some cases we would produce a corrupted EROFS blob - and in the cases I tested, the Linux kernel EROFS parser successfully detected the corruption.
The EROFS kernel code is actively fuzzed and fixed when bugs are found (e.g. this recent one) but still a goal for this project is to avoid exposing the Linux kernel code to a potentially corrupted EROFS at all.
(A core part of the idea of composefs is that the EROFS metadata doesn't need to be transported "on the wire", it can be re-synthesized reproducibly from other metadata, such as existing OCI tar layers, or ostree commits, etc.)
Autotools build system dropped
- build-sys: Remove autotools by @cgwalters in #313
The only supported build system is now meson.
Potentially incompatible changes
- mkcomposefs: Process last content in dumpfile without newline by @cgwalters in #331
We believe this is unlikely to break anyone, but if it does we are open to reverting this change.
New features
- dump: Support
--filter
by @cgwalters in #320
Other changes
- lib: Bail on xattr names > XATTR_NAME_MAX by @cgwalters in #314
- lib: Verify mode values by @cgwalters in #315
- Reject an empty name by @cgwalters in #318
- Two more testing improvements by @cgwalters in #317
- More validation by @cgwalters in #319
- rust/dumpfile: Minor optimization for unescape_to_path_canonical by @cgwalters in #321
- rust: Attempt to fix build on docs.rs by @cgwalters in #322
- dump: Support
--filter
by @cgwalters in #320 - rust: Add wrapping for composefs-info dump by @cgwalters in #323
- Various fixes to the fsverity part of test-units.sh by @alexlarsson in #325
- Replace custom clang-format bits with stock meson targets by @cgwalters in #326
- Add 64bit rdev APIs by @cgwalters in #329
- libcomposefs: detect short erofs files by @allisonkarlitskaya in #333
- rust: Accept 64 bit values for rdev by @cgwalters in #330
- A few cleanups around symlinks by @cgwalters in #337
- tests: Move sha verification after other checks by @cgwalters in #338
- ci: update deprecated {up,down}load-artifact@v2 to v4 by @jeckersb in #339
- dumpfile: Add some test code to convert to tar by @cgwalters in #328
- mkcomposefs: Add a hidden CFS_PARSE_STRICT by @cgwalters in #340
- Results from running honggfuzz, plus some more manual auditing by @cgwalters in #342
- lib: Move validation out of lcfs_node_add_child() by @cgwalters in #341
- writer: Clarifications around our usage of EROFS_NULL_ADDR by @cgwalters in #345
- Release 1.0.6 by @cgwalters in #346
New Contributors
- @allisonkarlitskaya made their first contribution in #333
- @jeckersb made their first contribution in #339
Full Changelog: v1.0.5...v1.0.6