Commit 0c93530
authored
fix(wasip1):
* fix(wasip1): prevent duplicate FD usage
The implementation assumed that only the runtime could ever issue FDs,
however that's not the case in p1, where guests can choose arbitrary
FDs to use (e.g. via `fd_renumber`).
Due to incorrect accounting, guests could "mark" arbitrary FDs as "free"
and trigger a panic in the host by requesting a new FD.
Signed-off-by: Roman Volosatovs <[email protected]>
* test(wasip1): expand `fd_renumber` test
Signed-off-by: Roman Volosatovs <[email protected]>
* doc: add release notes
Signed-off-by: Roman Volosatovs <[email protected]>
* test(wasip1): ignore `fd_renumber` tests when using adapter
Signed-off-by: Roman Volosatovs <[email protected]>
* refactor(wasip1): do not modify descriptors on `fd_renumber(n, n)`
Since `remove` is now only used once, remove it.
As a sideffect, this makes the implementation more explicit .
Signed-off-by: Roman Volosatovs <[email protected]>
* doc: reference the CVE
prtest:full
Signed-off-by: Roman Volosatovs <[email protected]>
---------
Signed-off-by: Roman Volosatovs <[email protected]>fd_renumber panic in the host (#11276)1 parent a5ed9fb commit 0c93530
File tree
5 files changed
+69
-42
lines changed- crates
- test-programs/src/bin
- wasi
- src
- tests/all/p2
5 files changed
+69
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
77 | 109 | | |
78 | 110 | | |
79 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 288 | + | |
304 | 289 | | |
305 | 290 | | |
306 | 291 | | |
| |||
377 | 362 | | |
378 | 363 | | |
379 | 364 | | |
380 | | - | |
| 365 | + | |
381 | 366 | | |
382 | 367 | | |
383 | 368 | | |
384 | 369 | | |
385 | | - | |
| 370 | + | |
386 | 371 | | |
387 | 372 | | |
388 | 373 | | |
389 | 374 | | |
390 | 375 | | |
391 | | - | |
| 376 | + | |
392 | 377 | | |
393 | 378 | | |
394 | 379 | | |
395 | 380 | | |
396 | 381 | | |
397 | 382 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 383 | | |
407 | 384 | | |
408 | 385 | | |
409 | 386 | | |
410 | | - | |
| 387 | + | |
411 | 388 | | |
412 | 389 | | |
413 | 390 | | |
414 | 391 | | |
415 | | - | |
| 392 | + | |
416 | 393 | | |
417 | 394 | | |
418 | 395 | | |
| |||
453 | 430 | | |
454 | 431 | | |
455 | 432 | | |
456 | | - | |
| 433 | + | |
457 | 434 | | |
458 | 435 | | |
459 | 436 | | |
460 | 437 | | |
461 | 438 | | |
462 | 439 | | |
463 | 440 | | |
464 | | - | |
| 441 | + | |
465 | 442 | | |
466 | 443 | | |
467 | 444 | | |
| |||
471 | 448 | | |
472 | 449 | | |
473 | 450 | | |
474 | | - | |
| 451 | + | |
475 | 452 | | |
476 | 453 | | |
477 | 454 | | |
| |||
485 | 462 | | |
486 | 463 | | |
487 | 464 | | |
488 | | - | |
| 465 | + | |
489 | 466 | | |
490 | 467 | | |
491 | 468 | | |
| |||
518 | 495 | | |
519 | 496 | | |
520 | 497 | | |
521 | | - | |
| 498 | + | |
522 | 499 | | |
523 | 500 | | |
524 | 501 | | |
| |||
1327 | 1304 | | |
1328 | 1305 | | |
1329 | 1306 | | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1335 | 1314 | | |
1336 | 1315 | | |
1337 | 1316 | | |
| |||
1830 | 1809 | | |
1831 | 1810 | | |
1832 | 1811 | | |
1833 | | - | |
1834 | | - | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1835 | 1823 | | |
1836 | 1824 | | |
1837 | 1825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
0 commit comments