List, ListView and VarBin arrays do not check offsets in device memory

未關閉
#11,795 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust
領域
data, security

研究方向

Start with the offsets.is_host() guards in list/array.rs, listview/array.rs and varbin/array.rs, and the comment in list/array.rs about device consumers. Read #11222 to see how the host-side check reads offset values. Done means offsets in device memory are validated before any value read, with tests covering unsorted and out-of-range device offsets. Deciding how to read device memory for the check is the open design question.

由索引模型根據 Issue 內容生成。

描述

Follow-up to #11222.

ListArray, ListViewArray and VarBinArray check their offsets when they are built: the offsets must be sorted, non-negative and within the length of the elements or bytes. #11222 makes ListArray and VarBinArray read the offset values for this check instead of the statistics of the offsets, because statistics can come from an untrusted file. ListViewArray already read the values. All three run the check only when the offsets are in host memory (the offsets.is_host() guards in list/array.rs, listview/array.rs and varbin/array.rs). Offsets in device memory are not checked.

So an array whose offsets are in device memory, for example after vortex-cuda decodes a file on the GPU, can be built with offsets that are not sorted or that point past the end of its elements or bytes. A kernel or an Arrow device export that trusts those offsets can then read out of bounds on the device. A comment in list/array.rs states the gap ("Device consumers must not assume device offsets were checked"), but nothing enforces it, and I have not checked which vortex-cuda paths build these arrays from file data.

Expected: an array with offsets in device memory has its offsets checked before any consumer reads values through them, as host arrays do.

🤖 Generated with Claude Code

主要語言
Rust
星號
3.2k
分支
239
平均合併
1 天 4 小時
30 天內合併 PR
684

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

vortex-data/vortex 的其他 Issue

查看 vortex-data/vortex 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。