Skip to content

[56_maintenance] Prevent BitChunks length overflow (#9818)#9896

Merged
alamb merged 1 commit intoapache:56_maintenancefrom
alamb:alamb/backport_9818
May 6, 2026
Merged

[56_maintenance] Prevent BitChunks length overflow (#9818)#9896
alamb merged 1 commit intoapache:56_maintenancefrom
alamb:alamb/backport_9818

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented May 5, 2026

@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 5, 2026

alamb added a commit that referenced this pull request May 5, 2026
…#9902)

NOTE: almost all of this PR is `Cargo.lock` files. I swear it is easy to
review...

- Part of #9857
- Follow-up to #9896

# Rationale

The MSRV check is failing on 56 (I saw on
#989) due to the fact that many
of arrow's dependencies have upgraded to a newer version of rust that
has a newer MSRV.

Here is an example CI fail
https://github.com/apache/arrow-rs/actions/runs/25373570591/job/74402867748?pr=9896

```
  Run if which cargo-msrv ; then echo "using existing cargo-msrv binary" ; else cargo
  install cargo-msrv ; fi
    if which cargo-msrv ; then echo "using existing cargo-msrv binary" ; else cargo install
  cargo-msrv ; fi
    shell: sh -e {0}
    env:
      RUSTFLAGS: -C debuginfo=1
      RUST_BACKTRACE: 1
      Updating crates.io index
  error: cannot install package `cargo-msrv 0.19.3`, it requires rustc 1.91.1 or newer,
  while the currently active rustc version is 1.89.0
  `cargo-msrv 0.18.4` supports rustc 1.85
  Error: Process completed with exit code 101.
```

This PR:
- Pins `cargo-msrv` in the `56_maintenance` MSRV CI job to a version
compatible with the Rust toolchain used by the job
- Checks in a Cargo.lock file so the older versions of the crate still
run

Note this doesn't actually change any code in this crate. It simply
updates the CI enough to get the tests to pass
- None.

BitChunks used unchecked usize arithmetic when validating bit offset
plus length. In optimized builds, very large lengths could wrap this
bounds check before constructing the iterator state.

This adds checked arithmetic for BitChunks bounds validation

Yes. This adds regression coverage for overflowing bit offset plus
length validation.

Invalid BitChunks inputs whose offset and length cannot be represented
without overflow now panic consistently. There are no API changes.
@alamb alamb force-pushed the alamb/backport_9818 branch from df72936 to 8aa4b5b Compare May 5, 2026 19:43
@alamb alamb marked this pull request as ready for review May 5, 2026 20:30
Copy link
Copy Markdown
Contributor

@etseidl etseidl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked against main and looks good

@alamb alamb merged commit 17832a4 into apache:56_maintenance May 6, 2026
26 checks passed
@alamb
Copy link
Copy Markdown
Contributor Author

alamb commented May 6, 2026

Thank you @etseidl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants