metsw24-max opened a new issue, #50292:
URL: https://github.com/apache/arrow/issues/50292
### Describe the bug, including details regarding any error messages,
version, and platform.
`RowGroupPageIndexReaderImpl::CheckReadRangeOrThrow` in
`cpp/src/parquet/page_index.cc` validates that a column chunk's page-index
location lies inside the coalesced `WillNeed` read range using raw signed int64
additions:
```cpp
if (index_location.offset < index_read_range->offset ||
index_location.offset + index_location.length >
index_read_range->offset + index_read_range->length) {
```
The `offset`/`length` come from the Thrift `ColumnChunk` metadata. For a
column outside a `WillNeed` selection these are not otherwise bounds-checked
here, so an offset near `INT64_MAX` wraps `offset + length` to a negative value
(signed-overflow UB, confirmed under UBSan). The out-of-range check then
passes, and `GetColumnIndex`/`GetOffsetIndex` go on to compute `buffer_offset =
location.offset - range.offset` and read `length` bytes at `buffer->data() +
buffer_offset`, an out-of-bounds read.
The neighbouring `merge_range` logic in the same file already uses
`AddWithOverflow`; this check should do the same.
### Component(s)
C++, Parquet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]