[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 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复