Out-of-bounds read for corrupt view offsets in BaseVariableWidthViewVector
評估
研究方向
從 BaseVariableWidthViewVector 開始,檢查 getData、getDataPointer、hashCode、copyFromNotNull 和 splitAndTransferViewBufferAndDataBuffer 中對 out-of-line view 的處理。比較連結的 pull request,然後驗證損壞的 buffer 索引和 offset/length 範圍不再允許越界讀取,包括啟用 unsafe memory access 的情況。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
ViewVarCharVector/ViewVarBinaryVector store values longer than INLINE_SIZE (12 bytes) out of line, encoding a data-buffer index and an offset inline in the view buffer. When a vector is loaded from an IPC stream these fields come straight from the input.
BaseVariableWidthViewVector dereferences them verbatim in getData, getDataPointer, hashCode, copyFromNotNull and splitAndTransferViewBufferAndDataBuffer, e.g.
dataBuffers.get(bufferIndex).getBytes(dataOffset, result, 0, dataLength);
Nothing checks that bufferIndex is in range or that dataOffset + dataLength fits inside the referenced data buffer. A crafted view whose offset/length points past the data buffer produces an out-of-bounds read: with the default bounds checking it throws IndexOutOfBoundsException, but with arrow.enable_unsafe_memory_access=true (commonly set in production) it reads arbitrary native heap into the returned value.
Component(s)
Java
- 主要語言
- Java
- 星號
- 95
- 分支
- 154
- 平均合併
- 2 天 10 小時
- 30 天內合併 PR
- 11
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/arrow-java 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1261 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1236 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1230 ·
-
Type: bug
難度 2/5 1-3 小時 新手友好度 85/100
apache/arrow-java#1205 ·
-
Type: bug
難度 2/5 1-3 小時 新手友好度 68/100
apache/arrow-java#1196 · 1 則留言 ·
查看 apache/arrow-java 的全部 Issue
相似的 Issue
-
bug
難度 1/5 1 小時以內 新手友好度 90/100
apache/cloudstack#14222 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
-
1.0.0-alpha2 Type/Improvement
難度 2/5 1-3 小時 新手友好度 68/100
wso2/dpdp-accelerator#272 ·
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
apache/rocketmq-dashboard#4860 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
infinispan/infinispan#18150 ·