nodejs / uvwasi

WASI syscall API built atop libuv
MIT License
222 stars 48 forks source link

`fd_pread` with a large offset causes implementation-defined behavior #257

Closed yagehu closed 2 months ago

yagehu commented 3 months ago

Passing in an offset to fd_pread greater than s64 max results in implementation-defined behavior. For example, it can wrap around and potentially read from a smaller offset. This happens because of an implicit unsigned -> signed integer conversion in the fd_pread implementation.

Other runtimes like Wasmtime will return inval (28).