bytecodealliance / bytecodealliance/wasmtime
wasmtime symlink resolution policy may be too strict
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
### Test Case
```c
#include
#include
#include
#include
#include
int main(int argc, char *argv[]) {
chdir(argv[1]);
if(fopen("bar", "rb") == NULL) {
perror(strerror(errno));
exit(errno);
}
}
```
### Steps to Reproduce
Use `wasi-sdk` to compile & link `foo.c` above to `foo.wasm`, then:
```
$ touch /tmp/bar
$ ln -s /tmp/bar bar
$ wasmtime run --mapdir /::/ -- foo.wasm $PWD
```
### Actual Results
The example above would fail with `Operation not permitted`. However, I've explicitly passed `--mapdir /::/` to `wasmtime`, so the entire host filesystem should be visible within the wasm module, and symlink resolution from `$PWD/bar` to `/tmp/bar` should work out of the box.
### Versions and Environment
Wasmtime version or commit: `wasmtime-cli 7.0.0`
Operating system: `Ubuntu 22.10`
Architecture: `x86_64`
Contributor guide
Assessment
This issue has not been assessed yet.