JSPI shadow stack management
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, rust, wasm
- Área
- compilers
Línea de trabajo
Comienza con el punto de entrada emscripten_stack_get_current() y el comportamiento de la pila sombra de WebAssembly.promising descrito en el issue. Compara los dos enfoques propuestos —el tratamiento por parte del compilador/toolchain o un nuevo primitivo emscripten_stack_get_promising_top()— y el trabajo relacionado de Pyodide y wasm-bindgen. Se considera terminado cuando se haya establecido una convención interoperable y sólida para la suspensión y reanudación de la pila sombra de Rust JSPI.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Pyodide implemented JSPI shadow stack suspend/resume semantics quite comprehensively in https://blog.pyodide.org/posts/jspi-with-c-runtime/.
I'm now seeing similar issues for Rust and JSPI, and have been prototyping some (unfinished) ideas in https://github.com/guybedford/jspi - where as far as I can tell Emscripten is not automatically handling the shadow stack save and restore operations, so that JSPI will lead to stack corruption in Rust per Hood's blog post scenario.
In addition, wasm-bindgen is about to land support for JSPI with it's own shadow stack handling in https://github.com/wasm-bindgen/wasm-bindgen/pull/5193 and to get these approaches to interoperate well requires falling on strong conventions.
All conventions come down to needing a stack top though for the shadow stack suspension range. And the stack top is not easy to get since by the time you call emscripten_stack_get_current() you're always deep into the entry point Rust wrapper code.
We can't use the stack base, because WebAssembly.promising functions can be called with arbitrary non-JSPI stack depth, so this core feature missing to integrate this well into Rust seems to me to be a emsripten_stack_get_promising_top() for the current WebAssembly.promising which Emscripten in theory would know about.
Unless I'm missing something, as far as I can tell this leaves us with two options for Rust JSPI soundness:
- Either fully implement the shadow stack save/restore work at the compiler / toolchain level (instead of as a library)
- Expose a new JSPI-specific
emscripten_stack_get_promising_top()primitive
I'd be interested to hear what others think about how to handle the problems here.
- Lenguaje dominante
- C++
- Estrellas
- 27.8k
- Forks
- 3.6k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 181
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 emscripten-core/emscripten
-
`other.test_cmake_cxx_import_std` fails on CMake 3.30–4.0.2 due to missing `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` UUIDsPosiblemente ocupada @subhaushsingh la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
emscripten-core/emscripten#28160 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
emscripten-core/emscripten#27994 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precisionPosiblemente ocupada @TheTomBritton la tomó hace 14 días. AbiertoDesktop OpenGL emulation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
emscripten-core/emscripten#27948 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
emscripten-core/emscripten#27906 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
run_python, run_python_compiler could readlink -fPosiblemente ocupada @kapouer la tomó hace 129 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
emscripten-core/emscripten#27211 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de emscripten-core/emscripten
Issues similares
-
libc++ test-suite
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
llvm/llvm-project#239851 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
scipy/xsf#454 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
comp-documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
ClickHouse/ClickHouse#129829 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
EchoTools/nevr-runtime#2263 ·
Los mantenedores suelen responder en 1 día