From 490de8ae0d562e1c3a45a91ee8a09bc0800e2298 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Oct 2015 22:13:08 +0300 Subject: [PATCH] [FIX] Us_manager: memory access on unregister Previously put_user() lead to a deadlock in kernel Change-Id: I8f1497225ea76e771003f9f16a18a1efa41235e4 Signed-off-by: Alexander Aksenov --- uprobe/arch/x86/swap-asm/swap_uprobes.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/uprobe/arch/x86/swap-asm/swap_uprobes.c b/uprobe/arch/x86/swap-asm/swap_uprobes.c index 352d75c..e8b47a4 100644 --- a/uprobe/arch/x86/swap-asm/swap_uprobes.c +++ b/uprobe/arch/x86/swap-asm/swap_uprobes.c @@ -211,19 +211,15 @@ int arch_prepare_uretprobe(struct uretprobe_instance *ri, struct pt_regs *regs) static bool get_long(struct task_struct *task, unsigned long vaddr, unsigned long *val) { - return task->mm == current->mm ? - !!get_user(*val, (unsigned long *)vaddr) : - sizeof(*val) != read_proc_vm_atomic(task, vaddr, - val, sizeof(*val)); + return sizeof(*val) != read_proc_vm_atomic(task, vaddr, + val, sizeof(*val)); } static bool put_long(struct task_struct *task, unsigned long vaddr, unsigned long *val) { - return task->mm == current->mm ? - !!put_user(*val, (unsigned long *)vaddr) : - sizeof(*val) != write_proc_vm_atomic(task, vaddr, - val, sizeof(*val)); + return sizeof(*val) != write_proc_vm_atomic(task, vaddr, + val, sizeof(*val)); } /** -- 2.7.4