kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Kprobes: change the kernel's execution path?
@ 2016-05-04  0:20 Sargun Dhillon
  0 siblings, 0 replies; only message in thread
From: Sargun Dhillon @ 2016-05-04  0:20 UTC (permalink / raw)
  To: kernelnewbies

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?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-04  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04  0:20 Kprobes: change the kernel's execution path? Sargun Dhillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).