DecimalVector.setBigEndian writes oversized value before validating length
まだ誰も着手していません。
評価
調査の方向性
DecimalVector.setBigEndian と Decimal256Vector.setBigEndian から始め、次に setBigEndianSafe と比較してください。固定幅スロットと長さの検証がどのように処理されているかを調べてください。ゼロではないスロットに対するサイズ超過の入力を再現し、無効な長さが引き続き例外をスローする一方で、隣接するメモリが変更されないことを示すテストカバレッジを追加してください。3つのエントリポイントすべてが書き込み前にサイズ超過の値を拒否すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
DecimalVector.setBigEndian(int, byte[]) and Decimal256Vector.setBigEndian(int, byte[]) validate the input length only after copying the bytes. On a little-endian platform the method byte-swaps the value into the fixed 16/32-byte slot with a loop of unchecked MemoryUtil.putByte writes:
for (int byteIdx = 0; byteIdx < length; ++byteIdx) {
MemoryUtil.putByte(outAddress + byteIdx, value[length - 1 - byteIdx]);
}
...
throw new IllegalArgumentException("Invalid decimal value length. Valid length in [1 - 16], got " + length);
If value.length exceeds the type width, the loop writes past the slot into adjacent off-heap memory before the IllegalArgumentException is thrown. MemoryUtil.putByte does no bounds checking, so this corrupts memory in the default configuration. setBigEndianSafe(int, long, ArrowBuf, int) performs the same write with no length check at all.
Reproducer: write a value into slot 1, then call setBigEndian(0, new byte[24]) on a DecimalVector; slot 1 is left corrupted (the write spills 8 bytes into it) even though the call throws.
- 主要言語
- Java
- スター
- 95
- フォーク
- 154
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 11
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 オープン
難易度 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 件 ·
-
agent-audit bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Vault-Web/cloud-page#144 ·