Signals from another process carry no siginfo

Ouverte
#541 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
56/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c, linux, macos

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
C
Étoiles
287
Forks
33
Merge moyen
2 j 17 h
PR mergées (30 j)
18

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sysprog21/elfuse

Toutes les issues de sysprog21/elfuse

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.