Linux 信号记录器

6 linux ubuntu kernel patch

我正在为 Linux 内核寻找一个信号记录器,而无需修补内核。

我发现很多关于补丁的文章,但我对此不感兴趣。

我正在运行默认的 Ubuntu 13.04。

# uname -a
Linux bt 3.8.0-26-lowlatency #18-Ubuntu SMP PREEMPT Tue Jun 25 22:36:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

我需要:pid, comm (sender) -> SIGNAL (number 0-31) -> pid, comm (catcher)

也会很棒:

  pidtree of sender ----- - - - - - receiver(cmd) ---- child1 of receiver, etc
              /                     \----child2---child1 of child2(cmd)
             ppid(+cmd)               ----child3(+cmd)
            /                          \__child4(+cmd)
           ppid of ppid(cmd)
          ....
         /
        init
Run Code Online (Sandbox Code Playgroud)

捕手也是一样。+ 时间戳。

我已经发现了什么:

superfrink.net:Chad Clark(2003 年 3 月 10 日版本)修补 Linux 用户空间信号记录(从用户空间程序发送的日志信号。)

grsecurity 补丁有类似的实现。

我需要轻松简单的方法来在 Ubuntu 上实现这一点。

Pau*_*esC 1

我可以给你一个部分解决方案。

使用Linux内核中的审计子系统。审计子系统记录核心转储信号。核心转储信号是:

  1. ABRT
  2. FPE
  3. 患病的
  4. 辞职
  5. SEGV
  6. 陷阱
  7. 系统
  8. 急救人员
  9. 公共汽车
  10. XCPU
  11. 新福泽

审核日志可以在 /var/log/audit.log 中找到。对于核心转储信号审核日志如下

type=ANOM_ABEND msg=audit(1386433952.455:141): auid=1000 uid=1000 gid=1000 ses=2 pid=6664 comm="bash" reason="memory violation" sig=24
Run Code Online (Sandbox Code Playgroud)

上面是一个在信号 SIGXCPU 上记录到 uid 1000 用户的进程 6664 上的示例。从该日志中您可以找出“catcher”的 comm 和 pid 的详细信息。请注意,日志中的原因字段已损坏。即使有了这个日志,我们仍然对发件人一无所知。

您可以在此处找到配置详细信息