eventfd, abstract socket and FUSE cleanup still match by fd number
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reading #408 and the fd-generation handling in src/syscall/fd.c; then trace eventfd_close and sys_eventfd2, absock_fd_cleanup and sys_close in src/syscall/net.c, and the FUSE cleanup paths in src/syscall/fuse.c. Run tests/test-special-fd-reuse.c and the eventfd reproduction described here. Done means cleanup cannot affect a replacement fd or lose its reference, and the reproduced reuse failures are fixed.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
fd_cleanup_entry runs a type's cleanup callback after fd_snapshot_and_close has freed the guest fd number, so a sibling thread's open can hold the number before the callback runs. #408 hands the callback the generation of the slot being closed, and pidfd, usbdev, timerfd, signalfd, inotify and netlink tear down by it. Three callbacks receive the generation and still match on the fd number alone:
eventfd_close(src/syscall/fd.c) readseventfd_owner[guest_fd], clears it and drops a reference on that slot. When a sibling'seventfd2has taken the number and set its own mapping, the close clears that mapping and drops that eventfd's reference. Aliases share one slot througheventfd_owner[], so the generation belongs on each owner mapping, not on the slot.sys_eventfd2has a second window on the create side:fd_allocpublishes the fd beforeeventfd_owner[gfd]is written undersfd_lock. A close in that window finds no owner and drops no reference, and the write that follows leaves the slot holding a reference no fd owns. When the number has been reused by then, the write also replaces the other eventfd's mapping.eventfd_dup_fdcloses this window for its destination by reserving the reference before the fd is published and committing underfd_lockandsfd_lock;sys_eventfd2does neither.absock_fd_cleanup(src/syscall/net.c) callsabsock_unregister_fd(guest_fd), which unlinks the socket file of theabsock_tableentry holding that number and deactivates it. When a sibling has bound an abstract name on the reused number, its name is removed while its socket is open.sys_closealso callsabsock_unregister_fddirectly, by number, ahead of the close, so keying the table by generation means that caller has to read the fd's generation first.fuse_fd_cleanup(src/syscall/fuse.c) callsfuse_unbind_file_fd_locked(guest_fd)andfuse_unbind_dev_fd_locked(guest_fd), and both matchguest_fdalone. A close that reaches a replacement's binding removes it and drops its alias reference. The bindings are shared between aliases through a refcount, so the per-fd match the other tables use does not carry over unchanged.
eventfd is reproduced; abstract sockets and FUSE are not. Four threads that each run eventfd, dup, close of the dup, an 8-byte write and read, and close for 1000 rounds: 3206 to 3252 of the 4000 eventfd() calls return ENOMEM over three runs, 18 to 23 of the write-read pairs fail, and with every fd closed afterwards 1 of the 32 slots can be allocated. tests/test-special-fd-reuse.c from #408 is the same shape: four threads that open, dup and close one kind of fd, each checking the fd it holds with a call that fails once the state behind it is gone. That test failed 5 of 5 runs for each of timerfd, signalfd, inotify and netlink before their tables matched by generation.
- Lenguaje dominante
- C
- Estrellas
- 271
- Forks
- 28
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 19
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/elfuse
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 48/100
Los mantenedores suelen responder en 2 días
Todos los issues de sysprog21/elfuse
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
EchoTools/nevr-runtime#171 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[P2] Workspace updates silently ignore forbidden assignments while staging the rowPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 4 días
-
sdl3-image update to 3.4.8Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/vcpkg#54338 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
area:http-gateway good first issue priority:low type:docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
crazy-goat/php-fpm-ng#828 ·
Los mantenedores suelen responder en 1 día