From 6bd773aa17f7c7acfbdb61bd39e7a5ac7b11c0f1 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Sun, 18 Jun 2023 16:30:57 -0400 Subject: [PATCH 1/3] Prepare v0.13.0 Release --- CHANGELOG.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 +-- src/lib.rs | 2 +- 5 files changed, 75 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74935717..095edf0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,76 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# Unreleased + +# [v0.13.0] - 2023-06-18 +## backhand +### Changes +- Decrease in memory usage for file reader and write ([#255](https://github.com/wcampbell0x2a/backhand/pull/255)) +- Remove unnecessary deconstruction/reconstruction of Vec when reading inodes ([@rbran](https://github.com/rbran)) ([#251](https://github.com/wcampbell0x2a/backhand/pull/251)) +- Only store file data compressed if it results in smaller size ([@rbran](https://github.com/rbran)) ([#250](https://github.com/wcampbell0x2a/backhand/pull/250)) +- Remove `lzo` being a default feature because of GPL license ([#240](https://github.com/wcampbell0x2a/backhand/pull/240)) +- Add support for OpenWRT compression options ([#239](https://github.com/wcampbell0x2a/backhand/pull/239)) +- Bump MSRV to `1.65.0` for latest `clap` requirements ([#253](https://github.com/wcampbell0x2a/backhand/pull/253)) +### Bug Fix +- Fix bug in generating Uid and Gid's with `FilesystemWriter`. All internal representation of Gid and Uid are changed to u32 ([#254](https://github.com/wcampbell0x2a/backhand/pull/254)) +- Remove case where invalid filesystem root_inode_offset would cause invalid bounds read panic. Found by fuzzer ([#245](https://github.com/wcampbell0x2a/backhand/pull/245)) + +### Complete API Updates +``` +$ cargo public-api -ss diff v0.12.0..HEAD +``` + +
+Click to expand + +```diff +Removed items from the public API +================================= +(none) + +Changed items in the public API +=============================== +-pub fn backhand::FilesystemWriter<'a>::set_root_gid(&mut self, gid: u16) ++pub fn backhand::FilesystemWriter<'a>::set_root_gid(&mut self, gid: u32) +-pub fn backhand::FilesystemWriter<'a>::set_root_uid(&mut self, uid: u16) ++pub fn backhand::FilesystemWriter<'a>::set_root_uid(&mut self, uid: u32) +-pub backhand::NodeHeader::gid: u16 ++pub backhand::NodeHeader::gid: u32 +-pub backhand::NodeHeader::uid: u16 ++pub backhand::NodeHeader::uid: u32 +-pub fn backhand::NodeHeader::new(permissions: u16, uid: u16, gid: u16, mtime: u32) -> Self ++pub fn backhand::NodeHeader::new(permissions: u16, uid: u32, gid: u32, mtime: u32) -> Self + +Added items to the public API +============================= ++pub backhand::compression::Xz::bit_opts: core::option::Option ++pub backhand::compression::Xz::fb: core::option::Option ++pub fn backhand::kind::Kind::magic(&self) -> [u8; 4] ++impl backhand::NodeHeader ++pub fn backhand::NodeHeader::from_inode(inode_header: InodeHeader, id_table: &[backhand::Id]) -> Self +``` + +
+ +## All binaries +## Changes +- jemalloc is now used for `-musl` release targets for performance reasons ([#254](https://github.com/wcampbell0x2a/backhand/pull/254)) +- `HAVE_DECODER_ARM`, `HAVE_DECODER_ARM64`, and `HAVE_DECODER_ARMTHUMB` filter flags are now defined for xz2. This only effects static build created in our CI. ([#254](https://github.com/wcampbell0x2a/backhand/pull/248)) +- Add `RUST_LOG` and available Decompressors to `--help` of all binaries ([#242](https://github.com/wcampbell0x2a/backhand/pull/242)) + +## add +### Changes +- Add `--dir` to create a empty directory ([#242](https://github.com/wcampbell0x2a/backhand/pull/242)) +### Bug Fix +- Add correctly reading new file metadata from `--file`, force other arguments for `--dir` ([#254](https://github.com/wcampbell0x2a/backhand/pull/254)) + +## unsquashfs +### Changes +- Add `--auto-offset` for automatic finding of initial SquashFS offset in image ([#241](https://github.com/wcampbell0x2a/backhand/pull/241)) +- Add possible `kind` values to `--help` output ([#236](https://github.com/wcampbell0x2a/backhand/pull/236)) +- Add `--path-filter` to limit file extraction to a path ([#237](https://github.com/wcampbell0x2a/backhand/pull/237)) + # [v0.12.0] - 2023-05-07 Thanks [@rbran](https://github.com/rbran/) for the contributions! diff --git a/Cargo.lock b/Cargo.lock index 0e70164f..d8352791 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,7 +101,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backhand" -version = "0.12.0" +version = "0.13.0" dependencies = [ "assert_cmd", "byte-unit", diff --git a/Cargo.toml b/Cargo.toml index afd6e28d..170ace70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "backhand" repository = "https://github.com/wcampbell0x2a/backhand" -version = "0.12.0" +version = "0.13.0" edition = "2021" rust-version = "1.65.0" license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index 2aaeb9fe..94a361f8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ backhand Library and binaries for the reading, creating, and modification of [SquashFS](https://en.wikipedia.org/wiki/SquashFS) file systems. -- **Library** — Backhand provides an easy way for programmatic analysis of Squashfs images, +- **Library** — Backhand provides an easy way for programmatic analysis of Squashfs 4.0 images, including the extraction and modification of images. - **Feature Flags** — Supported compression and decompression are feature flagged, so your final binary (or `unsquashfs`) only needs to include code to extract one type of image. @@ -24,7 +24,7 @@ Minimum supported rust version: `1.65.0` Add the following to your `Cargo.toml` file: ```toml [dependencies] -backhand = "0.12.0" +backhand = "0.13.0" ``` ### Reading/Writing/Modifying Firmware ```rust,no_run diff --git a/src/lib.rs b/src/lib.rs index cdd0af72..2dabb083 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ //! Add the following to your `Cargo.toml` file: //! ```toml //! [dependencies] -//! backhand = "0.12.0" +//! backhand = "0.13.0" //! ``` //! //! ### Reading From bf5f702c124546fa56fb5e6c16ae5c86d0082952 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Sun, 18 Jun 2023 18:36:20 -0400 Subject: [PATCH 2/3] ci: Fix release semver check --- .github/workflows/binaries.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index efb2b856..bc05e7f7 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -40,13 +40,14 @@ jobs: name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz path: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz - - name: Upload binary to release - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - uses: svenstaro/upload-release-action@v2 - # check semvar before release! + - name: Check semver + if: ${{ startsWith(github.ref, 'refs/tags/v') }} uses: obi1kenobi/cargo-semver-checks-action@v2 + - name: Upload binary to release + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz From 45dc80e847655b160db491548c2e7f947ae08869 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Sun, 18 Jun 2023 21:50:53 -0400 Subject: [PATCH 3/3] chore: Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 94a361f8..bed2b8d6 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Arguments: Path of file once inserted into squashfs Options: - -d, --dir Create directory + -d, --dir Create empty directory -f, --file Path of file to read, to write into squashfs -o, --out Squashfs output image [default: added.squashfs] --mode Overide mode read from @@ -132,11 +132,11 @@ Options: ## Performance See `./benches` using `cargo bench` to benchmark the library, or run `./bench.bash` to benchmark against system `squashfs-tools/unsquashfs`. -While there is still work to do, in most cases our speed is comparable or better than single-threaded `squashfs-tools/unsquashfs`. -Comparing memory usage, our `unsquashfs` beats `squashfs-tools` by using `18.1MB` instead of `74.8MB`. +While there is still work to do, in most cases our speed is comparable to single-threaded `squashfs-tools/unsquashfs`. +Comparing memory usage, our `unsquashfs` beats `squashfs-tools` by using `18.1MB` instead of `74.8MB` in the case of `test_re815_xev160/870D97.squashfs`. ## Testing This library is extensively tested with all library features and images from openwrt and extracted from manufacturers devices. -To run basic tests, use `cargo test --release`. +To run tests, use `cargo test --release`. To start fuzzing, run `cargo fuzz list` then pick one! Then start with `cargo fuzz run [NAME]`.