ilammy / ftrace-hook

Using ftrace for function hooking in Linux kernel
GNU General Public License v2.0
253 stars 70 forks source link

Killed by kernal #12

Open ygm521 opened 2 years ago

ygm521 commented 2 years ago

void hook__skb_get_hash(struct sk_buff *skb)
{
    pr_info("hook__skb_get_hash() before\n");

    // __skb_get_hash(skb);

    pr_info("hook__skb_get_hash() after\n");

}

static struct ftrace_hook demo_hooks[] = {
    // HOOK("sys_clone",  fh_sys_clone,  &real_sys_clone),
    HOOK("__skb_get_hash",  hook__skb_get_hash,  &__skb_get_hash),
};