Commit 4dbbac0
committed
cm-async: Cap read/write sizes on streams
The spec mandates that stream operations cannot exceed `2**28` elements,
but Wasmtime previously did not check for this limit. This meant that
the guest could get silently corrupt answers when trying to operate on
this many elements. This commit adds a new `ItemCount` newtype wrapper
which is intended to be proof of an in-bounds count and then that's
plumbed everywhere internally.
Closes bytecodealliance#130231 parent 9f8e3c7 commit 4dbbac0
File tree
5 files changed
+238
-83
lines changed- crates
- c-api
- include/wasmtime
- src
- environ/src
- wasmtime/src/runtime/component/concurrent
- tests/misc_testsuite/component-model/async
5 files changed
+238
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| |||
0 commit comments