[interpreter] Binary decoder rejects heap type indices >= 2^31 as malformed
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- wasm
調査の方向性
Start in interpreter/binary/decode.ml at the s33 decoding path around line 108, then compare how it handles the provided boundary indices 2^31 and 2^31 - 1. Run the interpreter against the included assert_invalid module and check the reported error. Done means 2^31 is decoded as a well-formed index and the module reports "unknown type" rather than "integer representation too long".
索引モデルが issue の本文から書いたものです。
説明
A heap type index is any non-negative s33:
So an index of 2^31 or 2^32 - 1 is well-formed, and a module using it is invalid (unknown type), not malformed. The decoder wraps the s33 to a signed 32-bit integer first and reports "integer representation too long":
;; (type (func (param (ref null 2147483648))))
(assert_invalid
(module binary "\00asm" "\01\00\00\00"
"\01\0a\01\60\01\63\80\80\80\80\08\00")
"unknown type")
The interpreter fails this with integer representation too long. Index 2^31 - 1 (\ff\ff\ff\ff\07) is reported as "unknown type" as expected.
Tested at 340650f.
- 主要言語
- WebAssembly
- スター
- 3.5k
- フォーク
- 540
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/spec のほかの issue
-
[interpreter] Text lexer accepts surrogate escapes and crashes on escapes past U+10FFFF対応中かも @rossberg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
WebAssembly/spec#2287 ·
メンテナーはふだん 1 日以内に返信
-
[spectec] SpecTec interpreter: array.new_data and array.init_data fail on arrays of v128対応中かも @rossberg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WebAssembly/spec#2285 ·
メンテナーはふだん 1 日以内に返信
-
[spectec] Tstringchar excludes \u{E000}..\u{E7FF}対応中かも @rossberg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WebAssembly/spec#2284 ·
メンテナーはふだん 1 日以内に返信
-
[interpreter] memory.grow on an i64 memory past 2^48 pages succeeds but allocates wrong amount (or crashes)対応中かも @rossberg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
WebAssembly/spec#2281 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
WebAssembly/spec#2297 ·
メンテナーはふだん 1 日以内に返信