I'm attempting to change the behaviour of the
inet_get_local_port_range function in the kernel, I've created a
kprobe that sets regs->ip = (unsigned
long)&inet_get_local_port_range_handler_fake in the pre_handler, and
returns 1. I've specified a post_handler to avoid kprobe optimization.

Unfortunately, I get a fault immediately after this. I saw in an
earlier mailing list post
(http://lkml.iu.edu/hypermail/linux/kernel/1310.2/02545.html)
suggesting to call reset_current_kprobe(), and
preempt_enable_no_resched(). Unfortunately these are not exported to
my module. Is there any other way to detour the kernel execution path?

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to