Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark the highlevel functions as unsafe. #24

Merged
merged 1 commit into from
Nov 23, 2019
Merged

Mark the highlevel functions as unsafe. #24

merged 1 commit into from
Nov 23, 2019

Conversation

sunfishcode
Copy link
Member

Following @RalfJung's comment here:

#8 (comment)

as long as the functions are still taking integer file descriptor
arguments, we should mark the APIs here unsafe.

This is particularly interesting in the context of WASI, as it aligns with
the OCap security model -- Rust's std::fs::File is an unforgeable
handle in safe Rust. So while there are still integer file descriptors at
the wasm level for now, programs compiled from safe Rust still have
fine-grained isolation (with the caveat that until reference types are
possible, this property isn't encoded in wasm in a verifiable way).

Following @RalfJung's comment here:

#8 (comment)

as long as the functions are still taking integer file descriptor
arguments, we should mark the APIs here `unsafe`.

This is particularly interesting in the context of WASI, as it aligns with
the OCap security model -- Rust's `std::fs::File` is an unforgeable
handle in safe Rust. So while there are still integer file descriptors at
the wasm level for now, programs compiled from safe Rust still have
fine-grained isolation (with the caveat that until reference types are
possible, this property isn't encoded in wasm in a verifiable way).
@alexcrichton alexcrichton merged commit 864f12e into master Nov 23, 2019
@sunfishcode sunfishcode deleted the unsafe-fd branch November 23, 2019 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants