I am writing a kernel module that hooks some system calls (e.g. tcp_send()
) using jprobes and sends some information to the userspace using netlink sockets.
netlink_unicast(nlsk, skb, pid, MSG_DONTWAIT);
my callback call is:
void nl_recv(struct sk_buff *skb) {
struct nlmsghdr *nlh;
if (skb == NULL) {
return;
}
nlh = (struct nlmsghdr *) skb->data;
pid = nlh->nlmsg_pid;
debug(KERN_NOTICE "Kernel Module: Received pid from %u\n", pid);
}
I'd like to pause the execution of my kernel module after every send. relaunch on receive. I have tried using completions and wait queues, but it seems that they push the session into a GPF.