Skip to content

Commit

Permalink
wasi: prevent syscalls before start
Browse files Browse the repository at this point in the history
PR-URL: #33235
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
tniessen authored and codebytere committed Jun 7, 2020
1 parent ad7a890 commit 33aacbe
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 45 deletions.
5 changes: 5 additions & 0 deletions doc/api/errors.md
Expand Up @@ -2082,6 +2082,11 @@ meaning of the error depends on the specific function.

The WASI instance has already started.

<a id="ERR_WASI_NOT_STARTED"></a>
### `ERR_WASI_NOT_STARTED`

The WASI instance has not been started.

<a id="ERR_WORKER_INIT_FAILED"></a>
### `ERR_WORKER_INIT_FAILED`

Expand Down
2 changes: 2 additions & 0 deletions src/node_errors.h
Expand Up @@ -54,6 +54,7 @@ void OnFatalError(const char* location, const char* message);
V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, TypeError) \
V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, Error) \
V(ERR_VM_MODULE_CACHED_DATA_REJECTED, Error) \
V(ERR_WASI_NOT_STARTED, Error) \
V(ERR_WORKER_INIT_FAILED, Error) \
V(ERR_PROTO_ACCESS, Error)

Expand Down Expand Up @@ -104,6 +105,7 @@ void OnFatalError(const char* location, const char* message);
V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, \
"Cannot serialize externalized SharedArrayBuffer") \
V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, "Failed to set PSK identity hint") \
V(ERR_WASI_NOT_STARTED, "wasi.start() has not been called") \
V(ERR_WORKER_INIT_FAILED, "Worker initialization failure") \
V(ERR_PROTO_ACCESS, \
"Accessing Object.prototype.__proto__ has been " \
Expand Down

0 comments on commit 33aacbe

Please sign in to comment.