GH-49229: [C++] Fix abort when reading IPC file with a union validity bitmap and pre-buffering enabled#49230
Open
pitrou wants to merge 1 commit intoapache:mainfrom
Open
GH-49229: [C++] Fix abort when reading IPC file with a union validity bitmap and pre-buffering enabled#49230pitrou wants to merge 1 commit intoapache:mainfrom
pitrou wants to merge 1 commit intoapache:mainfrom
Conversation
…lidity bitmap and pre-buffering enabled Found by OSS-Fuzz in https://issues.oss-fuzz.com/issues/482161154
Member
Author
|
@github-actions crossbow submit -g cpp |
|
Revision: 1b01906 Submitted crossbow builds: ursacomputing/crossbow @ actions-3993aded3b |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The logic for loading a Union array from a IPC file was inquiring whether a validity bitmap is present in a V4 metadata file (i.e.
buffers[0] != nullptr). However, in the pre-buffering case, the buffers haven't been populated yet at the point, so the check would be ignored and the IPC file reader could happily create a Union array with a top validity bitmap. This could crash later inUnionArray::SetData.Found by OSS-Fuzz in https://issues.oss-fuzz.com/issues/482161154
Are these changes tested?
By integration test and fuzz regression file. There are no unit tests in the C++ test suite that exercise V4 metadata IPC files with top-level union validity bitmaps.
Are there any user-facing changes?
No.
This PR contains a "Critical Fix". This fixes a controlled crash when reading a pre-V5 IPC file with a top-level union validity bitmap and pre-buffering enabled. Instead a regular error will be returned. There are no known security implications.