]> Git Repo - J-linux.git/blob - arch/x86/lib/error-inject.c
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / arch / x86 / lib / error-inject.c
1 // SPDX-License-Identifier: GPL-2.0
2
3 #include <linux/linkage.h>
4 #include <linux/error-injection.h>
5 #include <linux/kprobes.h>
6 #include <linux/objtool.h>
7
8 asmlinkage void just_return_func(void);
9
10 asm(
11         ".text\n"
12         ".type just_return_func, @function\n"
13         ".globl just_return_func\n"
14         ASM_FUNC_ALIGN
15         "just_return_func:\n"
16                 ANNOTATE_NOENDBR
17                 ASM_RET
18         ".size just_return_func, .-just_return_func\n"
19 );
20
21 void override_function_with_return(struct pt_regs *regs)
22 {
23         regs->ip = (unsigned long)&just_return_func;
24 }
25 NOKPROBE_SYMBOL(override_function_with_return);
This page took 0.024011 seconds and 4 git commands to generate.