error-inject.c 365 B

1234567891011121314
  1. // SPDX-License-Identifier: GPL-2.0+
  2. #include <asm/ptrace.h>
  3. #include <linux/error-injection.h>
  4. #include <linux/kprobes.h>
  5. void override_function_with_return(struct pt_regs *regs)
  6. {
  7. /*
  8. * Emulate 'br 14'. 'regs' is captured by kprobes on entry to some
  9. * kernel function.
  10. */
  11. regs->psw.addr = regs->gprs[14];
  12. }
  13. NOKPROBE_SYMBOL(override_function_with_return);