Repository navigation
GH-55476: [C++] Sanitize IPC message body length handling - #55634
Merged
Merged
Conversation
Member
Author
|
CI failures are unrelated. Would you like to take a look @adamreeve @wgtmac @WillAyd ? |
wgtmac
approved these changes
Nov 17, 2026
pitrou
force-pushed
the
gh55476-ipc-body-length
branch
from
November 17, 2026 10:24
e902169 to
d5d2c80
Compare
Member
Author
|
@github-actions crossbow submit -g cpp |
Member
Author
|
I'll be waiting for the original private submitter to tell how they want to be credited. |
This comment was marked as outdated.
This comment was marked as outdated.
pitrou
force-pushed
the
gh55476-ipc-body-length
branch
from
November 17, 2026 12:23
d5d2c80 to
f6862be
Compare
Member
Author
|
@github-actions crossbow submit -g cpp |
|
Revision: f6862be Submitted crossbow builds: ursacomputing/crossbow @ actions-2f2560a425 |
Member
Author
|
CI failures are unrelated. |
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
In the IPC reader, when a subset of column is asked for, we allocate an entire buffer with the same size as the body size advertised in the IPC message.
That allocation uses the default memory pool instead of a user-configured memory pool, which defeats any user-defined protection against memory expansion attacks using e.g.
CappedMemoryPool.This issue was initially detected and reported privately by Wei-Lun Li (GH account
b84330808- thank you!). We decided that it did not warrant private treatment according to our current security guidelines, as it does not threaten confidentiality or integrity.What changes are included in this PR?
Slightly refactor IPC message reading functions to allow passing a custom memory pool for the case where the message-reading function needs to allocate memory itself (instead of relying on the
RandomAccessFileto do it).Are these changes tested?
By existing unit tests, and by manual checking against a crafted invalid IPC file. While the crafted file would entail a huge memory allocation on without this PR, with this PR the IPC file reader errors out after detecting that the IPC message's body length is invalid.
Are there any user-facing changes?
An existing API is deprecated and superseded by a more flexible signature. These functions are unlikely to be called by user code, however.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: