Skip to content

fix: use correct length in runarray validation - #11668

Merged
alamb merged 3 commits into
apache:mainfrom
Jefffrey:run-fix-validation
Oct 19, 2026
Merged

alamb merged 3 commits into
apache:mainfrom
Jefffrey:run-fix-validation

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Fix incorrect validation of run arrays

What changes are included in this PR?

Use correct parent logical length when validating run values

Are these changes tested?

Yes

Are there any significant user-facing changes?

No

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @Jefffrey -- I took the liberty of pushing a few more tests.

I also spent some time reading / researching the contents of RunEndArrays and how they related to slicing and made a PR to improve the docs here:

@alamb
alamb enabled auto-merge October 19, 2026 17:59
@alamb

alamb commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks again @Jefffrey and @mbutrovich

@alamb
alamb added this pull request to the merge queue Oct 19, 2026
Merged via the queue into apache:main with commit a9455d4 Oct 19, 2026
35 checks passed
alamb added a commit that referenced this pull request Oct 20, 2026
- Backport #11668
- For inclusion in #11664

Cherry-pick of
a9455d4

Note: the cherry-pick conflicted, so the change was applied by hand. The
59 line does not have the `child_at` / non-integer run end type error
refactor, so this keeps the existing `child_data()[0]` /
`unreachable!()` code, and the tests use literal `"run_ends"` /
`"values"` field names because `Field::REE_*_FIELD_DEFAULT_NAME`
constants are not on the 59 line.

Co-authored-by: Jeffrey Vo <[email protected]>
@Jefffrey
Jefffrey deleted the run-fix-validation branch October 21, 2026 10:36
alamb added a commit that referenced this pull request Oct 21, 2026
- Backport #11668
- For inclusion in #11665

Cherry-pick of
a9455d4

Co-authored-by: Andrew Lamb <[email protected]>
alamb added a commit that referenced this pull request Oct 22, 2026
- Backport #11668
- For inclusion in #11666

Cherry-pick of
a9455d4

Co-authored-by: Andrew Lamb <[email protected]>
alamb added a commit to Rich-T-kid/arrow-rs that referenced this pull request Oct 30, 2026
…pache#11710)

# Which issue does this PR close?

- Related to apache#11587 and apache#11668

# Rationale for this change

While reviewing apache#11668 I was unclear about the relationship between a
`RunArray`'s logical `offset` / `len` and the contents of its `run_ends`
child as it was not documented anywhere on `RunArray` itself

# What changes are included in this PR?

Documentation only, on `pub struct RunArray`:

# Are these changes tested?

Yes, by CI

# Are there any significant user-facing changes?

Only docs

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: RIchard Baah <[email protected]>
lukekim added a commit to spiceai/arrow-rs that referenced this pull request Nov 5, 2026
Backport of apache#11668 / apache#11740 (RUSTSEC-2026-0442 /
CVE-2026-111959). check_run_ends previously compared the last run end
against the run-ends child's length (number of runs), so a RunEndEncoded
array whose logical offset+len past the last run end still validated.
Reading those rows indexed past the values child.

Pass the parent ArrayData's len and offset+len into check_run_ends, and
reject when parent_len > 0 and the last run end is short of that bound.
Includes the upstream regression tests.
lukekim added a commit to spiceai/arrow-rs that referenced this pull request Nov 5, 2026
Backport of apache#11668 / apache#11740 (RUSTSEC-2026-0442 /
CVE-2026-111959). check_run_ends previously compared the last run end
against the run-ends child's length (number of runs), so a RunEndEncoded
array whose logical offset+len past the last run end still validated.
Reading those rows indexed past the values child.

Pass the parent ArrayData's len and offset+len into check_run_ends, and
reject when parent_len > 0 and the last run end is short of that bound.
Includes the upstream regression tests.
lukekim added a commit to spiceai/spiceai that referenced this pull request Nov 5, 2026
…0442)

TEMPORARY pin to spiceai/arrow-rs#35 (6d198c9ed) until that merges into
spiceai-59. Upstream: apache/arrow-rs#11668 / #11740 (59.3.2+).
Workspace guard: arrow_tools rejects REE whose last run_end is below offset+len.

release/2.3 and release/1.11 stay on HOLD. Enterprise spicehq needs the same
bump once SAML SSO access is restored.
tsenart pushed a commit to perfloop-oss/spiceai that referenced this pull request Nov 6, 2026
…2) (spiceai#16040)

* fix(deps): bump spiceai/arrow-rs for RunEndEncoded OOB (RUSTSEC-2026-0442)

TEMPORARY pin to spiceai/arrow-rs#35 (a613c5c13) until that merges into
spiceai-59. Upstream fix: apache/arrow-rs#11668 / 59.3.2 backport spiceai#11740.
Workspace guard: arrow_tools rejects REE whose last run_end is below offset+len.

Enterprise (spicehq) needs the same bump once SAML SSO access is restored.

* fix(deps): retarget arrow-rs pin after fmt fix on spiceai#35

Bump TEMPORARY pin a613c5c13 → 6d198c9ed (cargo fmt trailing blank).

* fix: rustfmt stray blank before REE guard doc comment

Signoff cargo fmt --check failed on a double blank line before the
run_end_encoded_past_last_run_is_rejected doc comment in schema.rs.

* fix(deps): pin spiceai/arrow-rs to upstream 59.3.2 tip

TEMPORARY pin lukim/spiceai-59.3.2-patches @ e56e5cf4e (spiceai/arrow-rs#36)
until that merges into spiceai-59.3.2. RUSTSEC-2026-0442 fix is upstream in
59.3.2; supersedes the standalone spiceai/arrow-rs#35 backport.

* fix(deps): pin spiceai/arrow-rs to spiceai-59.3.2 merge commit

spiceai/arrow-rs#36 merged upstream 59.3.2 into spiceai-59.3.2 as
510ef234e1, whose tree is identical to the previously pinned
e56e5cf4e. Repoint all arrow*/parquet pins to it and drop the
TEMPORARY marker from the fork-patch ledger.

* fix: backtick RunEndEncoded in REE guard doc comment

Clippy doc_markdown under the lint gate. Also cite the upstream fix
instead of the superseded spiceai/arrow-rs#35.

---------

Co-authored-by: Sergei Grebnov <[email protected]>
Jeadie pushed a commit to spiceai/arrow-rs that referenced this pull request Nov 9, 2026
…he#11801)

- Backport apache#11668
- For inclusion in apache#11666

Cherry-pick of
apache@a9455d4

Co-authored-by: Andrew Lamb <[email protected]>
(cherry picked from commit 516aa56)

spiceai-57.2 adaptation: arrow-rs 57.2 does not have the
`checked_len_plus_offset` helper (upstream adds it in 57.3.1, apache#9925).
The RunEndEncoded arm does the same overflow check inline with
`checked_add`. This fixes RUSTSEC-2026-0442 (apache#11587).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArrayData validation does not check that run ends cover offset + len

2 participants