[interpreter] Binary decoder rejects heap type indices >= 2^31 as malformed
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- wasm
Línea de trabajo
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".
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- WebAssembly
- Estrellas
- 3.5k
- Forks
- 540
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 19
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de WebAssembly/spec
-
[interpreter] Text lexer accepts surrogate escapes and crashes on escapes past U+10FFFFPosiblemente ocupada @rossberg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
WebAssembly/spec#2287 ·
Los mantenedores suelen responder en 1 día
-
[spectec] SpecTec interpreter: array.new_data and array.init_data fail on arrays of v128Posiblemente ocupada @rossberg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
WebAssembly/spec#2285 ·
Los mantenedores suelen responder en 1 día
-
[spectec] Tstringchar excludes \u{E000}..\u{E7FF}Posiblemente ocupada @rossberg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
WebAssembly/spec#2284 ·
Los mantenedores suelen responder en 1 día
-
[interpreter] memory.grow on an i64 memory past 2^48 pages succeeds but allocates wrong amount (or crashes)Posiblemente ocupada @rossberg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
WebAssembly/spec#2281 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
WebAssembly/spec#2297 ·
Los mantenedores suelen responder en 1 día