Repository navigation
Commit ee66d23
lxutil: close the descriptor when fdopendir fails in DirectoryEnumerator::new
fdopendir takes ownership of the descriptor only on success. Converting
the OwnedFd to a raw fd before the call leaked it whenever fdopendir
failed, e.g. with ENOTDIR for a virtio-fs FUSE_READDIR on a regular file
handle, letting a guest exhaust the host process descriptors.
Keep the OwnedFd until fdopendir succeeds so failures close it.
(cherry picked from commit 7417a03)1 parent 5f4a47b commit ee66d23
1 file changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
451 | 478 | | |
0 commit comments