Skip to content

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
pitrou:ipc-fuzz-regression
Open

GH-49229: [C++] Fix abort when reading IPC file with a union validity bitmap and pre-buffering enabled#49230
pitrou wants to merge 1 commit intoapache:mainfrom
pitrou:ipc-fuzz-regression

Conversation

@pitrou
Copy link
Member

@pitrou pitrou commented Feb 11, 2026

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 in UnionArray::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.

@pitrou
Copy link
Member Author

pitrou commented Feb 11, 2026

@github-actions crossbow submit -g cpp

@pitrou pitrou marked this pull request as ready for review February 11, 2026 16:37
@github-actions
Copy link

Revision: 1b01906

Submitted crossbow builds: ursacomputing/crossbow @ actions-3993aded3b

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@pitrou
Copy link
Member Author

pitrou commented Feb 12, 2026

@lidavidm @WillAyd Would you like to take a look?

@pitrou pitrou added the Critical Fix Bugfixes for security vulnerabilities, crashes, or invalid data. label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review Awaiting review Component: C++ Critical Fix Bugfixes for security vulnerabilities, crashes, or invalid data.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant