-
Notifications
You must be signed in to change notification settings - Fork 924
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority-highHigh priority issueHigh priority issue🏚 staleInactive issues or PRInactive issues or PR📦 lib-vfsAbout wasmer-vfsAbout wasmer-vfs
Description
Describe the bug
Calling path_symlink with a non-directory descriptor and a new_path with only one component crashes Wasmer.
fn main() {
unsafe {
let base_fd = 5;
let fd = wasi::path_open(
base_fd,
0,
"dir/a",
wasi::OFLAGS_CREAT,
wasi::RIGHTS_FD_WRITE,
0,
0,
)
.unwrap();
wasi::path_symlink("a", fd, "link").unwrap();
}
}Wasmer commit: fb9a04b
Steps to reproduce
Compile the snippet with wasi crate v0.11 and run with wasmer:
cargo build --target wasm32-wasi
wasmer run --mapdir /dir:. target/wasm32-wasi/debug/example.wasm
Expected behavior
The function should return a error code.
Actual behavior
Wasmer panics:
thread 'main' panicked at lib/wasix/src/syscalls/wasi/path_symlink.rs:104:17:
internal error: entered unreachable code: get_parent_inode_at_path returned something other than a Dir or Root
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority-highHigh priority issueHigh priority issue🏚 staleInactive issues or PRInactive issues or PR📦 lib-vfsAbout wasmer-vfsAbout wasmer-vfs