Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to listen to new forks in kernel

kernel: 3.4+

Does anyone know of any other way beside using kernel process events connector to "listen" to new forks.

I want to be simply notified in my module every time a new task (process) is created.

like image 534
Daniel Meir Doron Avatar asked Jun 03 '15 14:06

Daniel Meir Doron


2 Answers

You could try to use a LSM hook to do this. The function you want to implement is security_task_create

like image 117
borisp Avatar answered Sep 30 '22 20:09

borisp


I don't know about the state of SystemTap but I think you can do a function boundary tracing like DTrace on Solaris using SystemTap. You'd need to know which linux kernel function to trace though, but that's the simpler part I presume.

like image 32
pavan Avatar answered Sep 30 '22 18:09

pavan