+++ Corey Henderson [02/04/17 17:33 -0600]:
Hey guys,

I've recently re-implemented my kernel security module to use ftrace: https://github.com/cormander/tpe-lkm

I've noticed that when there's another ftrace in place, like from a kpatch module, the instrumentation fails.

Is there a strategy where we can create a function that references a stack of functions that want to ftrace that single address and each function gets called?

ftrace already supports handling multiple callbacks for a single
location. However if multiple ftrace_ops have the IPMODIFY flag set,
only one will successfully register with ftrace, because we cannot
have multiple ftrace users modifying regs->ip at the same location,
it'd break things. See here: https://marc.info/?l=linux-kernel&m=141653698823819

kpatch has this flag set, since it modifies regs->ip to perform
function redirection, and it looks like you have this flag set in your
code as well, so that would explain why your instrumentation is
failing.

Jessica

_______________________________________________
kpatch mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/kpatch

Reply via email to