Skip to content

GH-46988: [C++][Parquet] Fix FLBA DecodeArrow multiply overflow#46991

Merged
mapleFU merged 2 commits intoapache:mainfrom
mapleFU:GH-46988
Jul 4, 2025
Merged

GH-46988: [C++][Parquet] Fix FLBA DecodeArrow multiply overflow#46991
mapleFU merged 2 commits intoapache:mainfrom
mapleFU:GH-46988

Conversation

@mapleFU
Copy link
Copy Markdown
Member

@mapleFU mapleFU commented Jul 4, 2025

Rationale for this change

See: #46988

Note that it's an old problem, not a new problem

What changes are included in this PR?

Add checkPageOverflow

Are these changes tested?

By arrow-testing file

Are there any user-facing changes?

No, just a minor bugfix

@mapleFU mapleFU requested a review from wgtmac as a code owner July 4, 2025 12:28
@mapleFU mapleFU requested review from pitrou and removed request for wgtmac July 4, 2025 12:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 4, 2025

⚠️ GitHub issue #46988 has been automatically assigned in GitHub to PR creator.

@mapleFU
Copy link
Copy Markdown
Member Author

mapleFU commented Jul 4, 2025

@pitrou It's an old problem, so maybe we can fix it after 21.0?

@pitrou
Copy link
Copy Markdown
Member

pitrou commented Jul 4, 2025

Can you first add the regression file to arrow-testing?

Comment thread cpp/src/parquet/decoder.cc Outdated
}
}

void checkPageOverflow(int32_t remain, int32_t arg1, int32_t arg2) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Several suggestions at once: 1) respect naming convention 2) make argument names more explicit 3) take int64_t, implicit widening will take place when calling with int32_t

Suggested change
void checkPageOverflow(int32_t remain, int32_t arg1, int32_t arg2) {
void CheckPageLargeEnough(int64_t remaining_bytes, int32_t value_width, int64_t num_values) {

@pitrou
Copy link
Copy Markdown
Member

pitrou commented Jul 4, 2025

Also, thanks a lot for tackling this!

@pitrou pitrou added this to the 21.0.0 milestone Jul 4, 2025
@pitrou pitrou added the Critical Fix Bugfixes for security vulnerabilities, crashes, or invalid data. label Jul 4, 2025
@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 4, 2025
@mapleFU
Copy link
Copy Markdown
Member Author

mapleFU commented Jul 4, 2025

Testing file: apache/arrow-testing#107

@mapleFU mapleFU requested a review from pitrou July 4, 2025 13:22
Copy link
Copy Markdown
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks a lot @mapleFU

@mapleFU mapleFU changed the title GH-46988: [C++][Parquet] Fix FLBA DecodeArrow multiple overflow GH-46988: [C++][Parquet] Fix FLBA DecodeArrow multiply overflow Jul 4, 2025
@mapleFU mapleFU merged commit aa45c12 into apache:main Jul 4, 2025
35 checks passed
@mapleFU mapleFU removed the awaiting committer review Awaiting committer review label Jul 4, 2025
@mapleFU mapleFU deleted the GH-46988 branch July 4, 2025 14:31
@amoeba amoeba removed the Critical Fix Bugfixes for security vulnerabilities, crashes, or invalid data. label Jul 4, 2025
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit aa45c12.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants