Patchwork [v2,2/4] uprobes: refuse uprobe on trap variants

login
register
mail settings
Submitter Ananth N Mavinakayanahalli
Date March 22, 2013, 3:17 p.m.
Message ID <20130322151758.GC20010@in.ibm.com>
Download mbox | patch
Permalink /patch/230091/
State Awaiting Upstream, archived
Headers show

Comments

Ananth N Mavinakayanahalli - March 22, 2013, 3:17 p.m.
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

Refuse to place a uprobe if a trap variant already exists in the
file copy at the address.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 kernel/events/uprobes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tulasidhar Dronamraju - March 26, 2013, 12:06 p.m.
* Ananth N Mavinakayanahalli <ananth@in.ibm.com> [2013-03-22 20:47:58]:

> From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> 
> Refuse to place a uprobe if a trap variant already exists in the
> file copy at the address.
> 
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

> ---
>  kernel/events/uprobes.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-3.9-rc3/kernel/events/uprobes.c
> ===================================================================
> --- linux-3.9-rc3.orig/kernel/events/uprobes.c
> +++ linux-3.9-rc3/kernel/events/uprobes.c
> @@ -573,7 +573,7 @@ static int prepare_uprobe(struct uprobe
>  		goto out;
> 
>  	ret = -ENOTSUPP;
> -	if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn))
> +	if (is_trap_insn((uprobe_opcode_t *)uprobe->arch.insn))
>  		goto out;
> 
>  	ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr);

Patch

Index: linux-3.9-rc3/kernel/events/uprobes.c
===================================================================
--- linux-3.9-rc3.orig/kernel/events/uprobes.c
+++ linux-3.9-rc3/kernel/events/uprobes.c
@@ -573,7 +573,7 @@  static int prepare_uprobe(struct uprobe
 		goto out;
 
 	ret = -ENOTSUPP;
-	if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn))
+	if (is_trap_insn((uprobe_opcode_t *)uprobe->arch.insn))
 		goto out;
 
 	ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr);