Stage 2 / C4: decide fork inheritance and exec reset deliberately

Chiusa
#153 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #274 di @pkgdemon — integrata

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
c

Direzione di ricerca

Read the linked Stage 2 plan and the existing ipc_entry_list_close, fdcopy(), ipc_entry_lookup, and mach_task_fork_bsport paths. First determine the intended fork inheritance and exec-reset behavior, using the comment about earlier panic as context; preserve both out-of-tree guards when rewriting close. Done means the behavior is deliberately decided and validated with a full launchd, syslogd, configd, and notifyd bring-up.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:mach enhancement

Mach port rights are currently inherited across fork() by accident. The child gets a fresh, empty ipc_space, yet can still use the parent's port names — because fdcopy() duplicated the fds and ipc_entry_lookup resolves through curthread's fd table and never checks entry->ie_space. Parent and child therefore share ipc_entry structs across two different spaces with conflated reference counts.

After Stage 2 the child's namespace is genuinely empty, so anything depending on that accident stops working. XNU's answer is a fresh space with special ports reset. Adopting it is correct but is a user-visible behaviour change for launchd-spawned daemons, so it must be decided rather than discovered.

Also rewrite ipc_entry_list_close, preserving both out-of-tree guards (non-Mach processes, and Linux-ABI processes) — each is a real crash fix.

This is where daemon-level regressions surface. Budget a full launchd / syslogd / configd / notifyd bring-up.

Open question: mach_task_fork_bsport inherits only itk_bootstrap and its comment says fuller inheritance 'tripped the earlier panic' — that history should inform the decision.

Part of #145. Plan: https://pkgdemon.github.io/nextbsd-mach-namespace-separation-plan.html

Lingua principale
C
Stelle
12
Fork
3
Merge medio
1h 46m
PR unite (30g)
93

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextbsd/nextbsd-kernel

Tutte le issue di nextbsd/nextbsd-kernel

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.