JSPI shadow stack management
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, rust, wasm
- Lĩnh vực
- compilers
Hướng nghiên cứu
Bắt đầu với entry point emscripten_stack_get_current() và hành vi shadow stack của WebAssembly.promising được mô tả trong issue. So sánh hai cách tiếp cận được đề xuất —xử lý ở compiler/toolchain hoặc một primitive mới emscripten_stack_get_promising_top()— cùng với công việc liên quan của Pyodide và wasm-bindgen. Được xem là hoàn tất khi thiết lập được một quy ước có khả năng tương tác và vững chắc cho việc tạm dừng và tiếp tục shadow stack của Rust JSPI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 27.8k
- Fork
- 3.6k
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 177
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của emscripten-core/emscripten
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
emscripten-core/emscripten#27994 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precisionCó thể đã có người làm @TheTomBritton đã nhận 14 ngày trước. Đang mởDesktop OpenGL emulation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
emscripten-core/emscripten#27948 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
emscripten-core/emscripten#27906 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
run_python, run_python_compiler could readlink -fCó thể đã có người làm @kapouer đã nhận 130 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
emscripten-core/emscripten#27211 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
emscripten_fetch_unpack_response_headers returns header values with leading and trailing whitespaceĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
emscripten-core/emscripten#27114 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của emscripten-core/emscripten
Issue tương tự
-
#2754 make deepseek api not workĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
xiaoyifang/goldendict-ng#3148 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[Bug]: Launching Space Calibrator causes Bluetooth mouse lag due to a 100% duty-cycle BLE scanCó thể đã có người làm @Yuuki204 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày