Signals from another process carry no siginfo

Aperta
#541 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, linux, macos

Direzione di ricerca

Start with signal_queue and signal_enqueue_locked in src/syscall/signal.c, then trace how transport records are created and drained through sig_drain_cb in src/syscall/proc.c. Compare the signal metadata described here with Linux’s do_notify_parent and __send_signal behavior. Done means transported SIGCHLD and kill signals preserve the sender and status details observed through the listed interfaces; verify using the fork and sigtimedwait cases in the issue.

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

Descrizione

A signal that reaches a guest through the signal transport is queued by
signal_queue in src/syscall/signal.c, which passes no siginfo to
signal_enqueue_locked. The receiver gets the default siginfo instead of the
sender's. Two paths go through the transport:

  • SIGCHLD from proc_process_exit: si_pid is not the child's pid, si_code
    is 0 instead of CLD_EXITED, CLD_KILLED or CLD_DUMPED, and si_status
    is 0 instead of the exit status.
  • kill() from another elfuse process: si_pid is not the sender's pid.

sigtimedwait, sigwaitinfo, signalfd (ssi_pid, ssi_status) and
SA_SIGINFO handlers all see these values. Linux fills them in when it
generates the signal (do_notify_parent and __send_signal in
kernel/signal.c).

Evidence

Block SIGCHLD and SIGUSR1, fork a child that calls _exit(7), and call
sigtimedwait. Then fork a child that calls kill(getppid(), SIGUSR1) and
call sigtimedwait again.

elfuse Linux 7.0
SIGCHLD si_pid=1, si_code=0, si_status=0 child pid, CLD_EXITED, 7
kill si_pid=1, si_code=SI_USER sender pid, SI_USER

Cause

A transport record is "ns target_pid signum". It has no field for the
sender's pid, uid, si_code or status, so the drain (sig_drain_cb in
src/syscall/proc.c) has nothing to pass on and calls signal_queue rather
than signal_queue_info.

Lingua principale
C
Stelle
287
Fork
33
Merge medio
2g 17h
PR unite (30g)
18

Preparare l'ambiente

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 sysprog21/elfuse

Tutte le issue di sysprog21/elfuse

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.