Commit d4ce35c
authored
cm-async: Cap read/write sizes on streams (#13086)
* 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 #13023
* Fix clippy
* Update wit-bindgen dependency1 parent d3aa8af commit d4ce35c
File tree
8 files changed
+267
-112
lines changed- crates
- c-api
- include/wasmtime
- src
- environ/src
- wasmtime/src/runtime/component/concurrent
- supply-chain
- tests/misc_testsuite/component-model/async
8 files changed
+267
-112
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
| 351 | + | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
| 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