From 6f860b5b29b62c71dae0072a685dfc962c5a2c70 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalenko Date: Tue, 10 Jul 2012 10:51:20 +0400 Subject: [PATCH] Fixed ARM/THUMB instructions safe checking (#372) --- kprobe/dbi_kprobes.c | 4 ++++ kprobe/dbi_uprobes.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kprobe/dbi_kprobes.c b/kprobe/dbi_kprobes.c index 11ff910..669c548 100644 --- a/kprobe/dbi_kprobes.c +++ b/kprobe/dbi_kprobes.c @@ -366,6 +366,10 @@ void copy_kprobe (struct kprobe *old_p, struct kprobe *p) memcpy (&p->ainsn, &old_p->ainsn, sizeof (struct arch_specific_insn)); p->tgid = old_p->tgid; p->ss_addr = old_p->ss_addr; +#ifdef CONFIG_ARM + p->safe_arm = old_p->safe_arm; + p->safe_thumb = old_p->safe_thumb; +#endif //p->spid = old_p->spid; } diff --git a/kprobe/dbi_uprobes.c b/kprobe/dbi_uprobes.c index 1007c71..d2bf5bf 100644 --- a/kprobe/dbi_uprobes.c +++ b/kprobe/dbi_uprobes.c @@ -78,6 +78,10 @@ int __register_uprobe (struct kprobe *p, struct task_struct *task, int atomic, u old_p = get_kprobe (p->addr, p->tgid, NULL); if (old_p) { +#ifdef CONFIG_ARM + p->safe_arm = old_p->safe_arm; + p->safe_thumb = old_p->safe_thumb; +#endif ret = register_aggr_kprobe (old_p, p); if (!ret) { atomic_inc (&kprobe_count); -- 2.7.4