]> git.baikalelectronics.ru Git - kernel.git/commit
connector: add an event for monitoring process tracers
authorVladimir Zapolskiy <vzapolskiy@gmail.com>
Fri, 15 Jul 2011 17:45:18 +0000 (20:45 +0300)
committerOleg Nesterov <oleg@redhat.com>
Mon, 18 Jul 2011 19:38:33 +0000 (21:38 +0200)
commit3a5fb11de130d829ff26a6b9630832c35c4e0e29
tree10940ea680a1c8c69cbd9f9aa9aca23a1199aa0e
parentd2785e82f2c7fca853d24a5aea479a68a5acbcf3
connector: add an event for monitoring process tracers

This change adds a procfs connector event, which is emitted on every
successful process tracer attach or detach.

If some process connects to other one, kernelspace connector reports
process id and thread group id of both these involved processes. On
disconnection null process id is returned.

Such an event allows to create a simple automated userspace mechanism
to be aware about processes connecting to others, therefore predefined
process policies can be applied to them if needed.

Note, a detach signal is emitted only in case, if a tracer process
explicitly executes PTRACE_DETACH request. In other cases like tracee
or tracer exit detach event from proc connector is not reported.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
drivers/connector/cn_proc.c
include/linux/cn_proc.h
kernel/ptrace.c