aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/probes.h
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2015-01-05 19:29:25 +0800
committerJon Medhurst <tixy@linaro.org>2015-01-13 16:10:15 +0000
commita0266c214fab21371a499e6ab1c9385cc6589189 (patch)
tree69accee3d0fdc9ae9a0c3c683a7ed87497e61a81 /arch/arm/include/asm/probes.h
parentARM: kprobes: collects stack consumption for store instructions (diff)
downloadlinux-dev-a0266c214fab21371a499e6ab1c9385cc6589189.tar.xz
linux-dev-a0266c214fab21371a499e6ab1c9385cc6589189.zip
ARM: kprobes: disallow probing stack consuming instructions
This patch prohibits probing instructions for which the stack requirements are unable to be determined statically. Some test cases are found not work again after the modification, this patch also removes them. Signed-off-by: Wang Nan <wangnan0@huawei.com> Reviewed-by: Jon Medhurst <tixy@linaro.org> Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'arch/arm/include/asm/probes.h')
-rw-r--r--arch/arm/include/asm/probes.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/include/asm/probes.h b/arch/arm/include/asm/probes.h
index 6026deb28794..cd9e81588d83 100644
--- a/arch/arm/include/asm/probes.h
+++ b/arch/arm/include/asm/probes.h
@@ -19,6 +19,8 @@
#ifndef _ASM_PROBES_H
#define _ASM_PROBES_H
+#ifndef __ASSEMBLY__
+
typedef u32 probes_opcode_t;
struct arch_probes_insn;
@@ -41,4 +43,14 @@ struct arch_probes_insn {
int stack_space;
};
+#endif /* __ASSEMBLY__ */
+
+/*
+ * We assume one instruction can consume at most 64 bytes stack, which is
+ * 'push {r0-r15}'. Instructions consume more or unknown stack space like
+ * 'str r0, [sp, #-80]' and 'str r0, [sp, r1]' should be prohibit to probe.
+ * Both kprobe and jprobe use this macro.
+ */
+#define MAX_STACK_SIZE 64
+
#endif