diff options
author | Wang Kefeng <wangkefeng.wang@huawei.com> | 2022-12-04 06:46:40 +0300 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-12-07 17:08:38 +0300 |
commit | aaa4dd1b47f5ff5ef477fec5dcc6c397b457f1c2 (patch) | |
tree | 3cd94c5410ffe0e7ddd3ddc6c758a531d99a7cb9 /arch/arm/lib/error-inject.c | |
parent | ba290d4f1f7733732896567d2a1874f01e20fff4 (diff) | |
download | linux-aaa4dd1b47f5ff5ef477fec5dcc6c397b457f1c2.tar.xz |
ARM: 9279/1: support function error injection
This enables HAVE_FUNCTION_ERROR_INJECTION by adding necessary
regs_set_return_value() and override_function_with_return().
Simply tested according to Documentation/fault-injection/fault-injection.rst.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/lib/error-inject.c')
-rw-r--r-- | arch/arm/lib/error-inject.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/lib/error-inject.c b/arch/arm/lib/error-inject.c new file mode 100644 index 000000000000..5a5b405792ba --- /dev/null +++ b/arch/arm/lib/error-inject.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/error-injection.h> +#include <linux/kprobes.h> + +void override_function_with_return(struct pt_regs *regs) +{ + instruction_pointer_set(regs, regs->ARM_lr); +} +NOKPROBE_SYMBOL(override_function_with_return); |