Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 
0003 #include <linux/error-injection.h>
0004 #include <linux/kprobes.h>
0005 #include <linux/uaccess.h>
0006 
0007 void override_function_with_return(struct pt_regs *regs)
0008 {
0009     /*
0010      * Emulate 'blr'. 'regs' represents the state on entry of a predefined
0011      * function in the kernel/module, captured on a kprobe. We don't need
0012      * to worry about 32-bit userspace on a 64-bit kernel.
0013      */
0014     regs_set_return_ip(regs, regs->link);
0015 }
0016 NOKPROBE_SYMBOL(override_function_with_return);