Skip to content

Commit 4465d23

Browse files
tniessencodebytere
authored andcommitted
wasi: prevent syscalls before start
PR-URL: #33235 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 6ffec50 commit 4465d23

File tree

4 files changed

+102
-45
lines changed

4 files changed

+102
-45
lines changed

doc/api/errors.md

+5
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,11 @@ meaning of the error depends on the specific function.
20992099

21002100
The WASI instance has already started.
21012101

2102+
<a id="ERR_WASI_NOT_STARTED"></a>
2103+
### `ERR_WASI_NOT_STARTED`
2104+
2105+
The WASI instance has not been started.
2106+
21022107
<a id="ERR_WORKER_INIT_FAILED"></a>
21032108
### `ERR_WORKER_INIT_FAILED`
21042109

src/node_errors.h

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void OnFatalError(const char* location, const char* message);
5454
V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, TypeError) \
5555
V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, Error) \
5656
V(ERR_VM_MODULE_CACHED_DATA_REJECTED, Error) \
57+
V(ERR_WASI_NOT_STARTED, Error) \
5758
V(ERR_WORKER_INIT_FAILED, Error) \
5859
V(ERR_PROTO_ACCESS, Error)
5960

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

0 commit comments

Comments
 (0)