-
Notifications
You must be signed in to change notification settings - Fork 824
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
fd_advise
on invalid file descriptors report ok
#4554
Comments
yagehu
added a commit
to yagehu/wasmer
that referenced
this issue
Apr 11, 2024
This commit fixes `fd_advise` unconditionally returning ok (0) on all inputs. The details are discussed in issue wasmerio#4554.
yagehu
added a commit
to yagehu/wasmer
that referenced
this issue
Apr 12, 2024
This commit fixes `fd_advise` unconditionally returning ok (0) on all inputs. The details are discussed in issue wasmerio#4554.
theduke
pushed a commit
to yagehu/wasmer
that referenced
this issue
Apr 15, 2024
This commit fixes `fd_advise` unconditionally returning ok (0) on all inputs. The details are discussed in issue wasmerio#4554.
theduke
pushed a commit
that referenced
this issue
Apr 15, 2024
This commit fixes `fd_advise` unconditionally returning ok (0) on all inputs. The details are discussed in issue #4554.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Calling
fd_advise
on a clearly invalid file descriptor returns 0 in all conditions.Minimal Rust repro:
$ wasmer -vV; rustc -vV wasmer 4.2.5 (0460050 2024-03-05) binary: wasmer-cli commit-hash: 04600507844bae978239531c8e6265d410aefe6d commit-date: 2024-03-05 host: x86_64-unknown-linux-gnu compiler: singlepass,cranelift rustc 1.77.1 (7cf61ebde 2024-03-27) binary: rustc commit-hash: 7cf61ebde7b22796c69757901dd346d0fe70bd97 commit-date: 2024-03-27 host: x86_64-unknown-linux-gnu release: 1.77.1 LLVM version: 17.0.6
Steps to reproduce
Run the above Rust snippet compiled to
wasm32-wasi
. It should outputfd_advise failed with <errno>
, but it reportsfd_advise ok
.Expected behavior
When the fd is invalid, like a random or very large number,
fd_advise
should report something likeebadf
.Actual behavior
fd_advise
returns ok (0) in all cases.Additional context
This was uncovered in differential fuzzing between Wasmer and other Wasm/WASI runtimes. I have a simple PR to fix this behavior.
The text was updated successfully, but these errors were encountered: