From: Rusty Lynch Date: Mon, 27 Jun 2005 22:17:15 +0000 (-0700) Subject: [PATCH] kprobes/ia64: refuse inserting kprobe on slot 1 X-Git-Tag: v2.6.13-rc1~51^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a528e21c235862cc1ae50e7809eb9116dc40ea0c;p=linux-2.6-omap-h63xx.git [PATCH] kprobes/ia64: refuse inserting kprobe on slot 1 Without the ability to atomically write 16 bytes, we can not update the middle slot of a bundle, slot 1, unless we stop the machine first. This patch will ensure the ability to robustly insert and remove a kprobe by refusing to insert a kprobe on slot 1 until a mechanism is in place to safely handle this case. Signed-off-by: Rusty Lynch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index c97e18e634c..ec2ceade12b 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -270,6 +270,13 @@ static int valid_kprobe_addr(int template, int slot, unsigned long addr) addr); return -EINVAL; } + + if (slot == 1 && bundle_encoding[template][1] != L) { + printk(KERN_WARNING "Inserting kprobes on slot #1 " + "is not supported\n"); + return -EINVAL; + } + return 0; }