JSPI shadow stack management
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- javascript, rust, wasm
- 领域
- compilers
调研方向
从 emscripten_stack_get_current() 入口点以及 issue 中描述的 WebAssembly.promising 影子栈行为开始。比较两种提议的方法——由编译器/toolchain 处理,或新增 emscripten_stack_get_promising_top() 原语——以及相关的 Pyodide 和 wasm-bindgen 工作。完成的标准是为 Rust JSPI 影子栈的挂起和恢复建立一个可互操作且健全的约定。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- C++
- 星标
- 27.8k
- 派生
- 3.6k
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 177
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
emscripten-core/emscripten 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
emscripten-core/emscripten#27994 · 2 条评论 ·
维护者通常 1 天内回复
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precision可能已有人在做 @TheTomBritton 于 15 天前认领。 未关闭Desktop OpenGL emulation
难度 2/5 1-3 小时 新手友好度 78/100
emscripten-core/emscripten#27948 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
emscripten-core/emscripten#27906 · 1 条评论 ·
维护者通常 1 天内回复
-
run_python, run_python_compiler could readlink -f可能已有人在做 @kapouer 于 131 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
emscripten-core/emscripten#27211 · 1 条评论 ·
维护者通常 1 天内回复
-
emscripten_fetch_unpack_response_headers returns header values with leading and trailing whitespace未关闭
难度 2/5 1-3 小时 新手友好度 64/100
emscripten-core/emscripten#27114 · 4 条评论 ·
维护者通常 1 天内回复
查看 emscripten-core/emscripten 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Niko1221/Strata#5560 · 2 条评论 ·
维护者通常 4 天内回复
-
NVIDIA windows
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
kind/bug priority/medium qa_automation
难度 2/5 1-3 小时 新手友好度 78/100
yugabyte/yugabyte-db#37324 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
CharlotteCross1998/awesome-game-decompilations#61 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
godotengine/godot#125240 ·
维护者通常 1 天内回复