Signals from another process carry no siginfo

未关闭
#541 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
c, linux, macos

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
C
星标
287
派生
33
平均合并
2 天 17 小时
30 天内合并 PR
18

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/elfuse 的其他 Issue

查看 sysprog21/elfuse 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。