All of lore.kernel.org
 help / color / mirror / Atom feed
* [ia64][patch] Refuse inserting kprobe on slot 1
@ 2005-06-23  2:32 ` Rusty Lynch
  0 siblings, 0 replies; 4+ messages in thread
From: Rusty Lynch @ 2005-06-23  2:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-ia64

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.

	--rusty

Signed-off-by: Rusty Lynch <rusty.lynch@intel.com>

 arch/ia64/kernel/kprobes.c |    7 +++++++
 1 files changed, 7 insertions(+)

Index: linux-2.6.12-mm1/arch/ia64/kernel/kprobes.c
===================================================================
--- linux-2.6.12-mm1.orig/arch/ia64/kernel/kprobes.c
+++ linux-2.6.12-mm1/arch/ia64/kernel/kprobes.c
@@ -270,6 +270,13 @@ static int valid_kprobe_addr(int templat
 				addr);
 		return -EINVAL;
 	}
+
+	if (slot == 1) {
+		printk(KERN_WARNING "Inserting kprobes on slot #1 "
+		       "is not supported\n");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ia64][patch] Refuse inserting kprobe on slot 1
@ 2005-06-23  2:32 ` Rusty Lynch
  0 siblings, 0 replies; 4+ messages in thread
From: Rusty Lynch @ 2005-06-23  2:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-ia64

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.

	--rusty

Signed-off-by: Rusty Lynch <rusty.lynch@intel.com>

 arch/ia64/kernel/kprobes.c |    7 +++++++
 1 files changed, 7 insertions(+)

Index: linux-2.6.12-mm1/arch/ia64/kernel/kprobes.c
=================================--- linux-2.6.12-mm1.orig/arch/ia64/kernel/kprobes.c
+++ linux-2.6.12-mm1/arch/ia64/kernel/kprobes.c
@@ -270,6 +270,13 @@ static int valid_kprobe_addr(int templat
 				addr);
 		return -EINVAL;
 	}
+
+	if (slot = 1) {
+		printk(KERN_WARNING "Inserting kprobes on slot #1 "
+		       "is not supported\n");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ia64][patch] Refuse inserting kprobe on slot 1
  2005-06-23  2:32 ` Rusty Lynch
@ 2005-06-23 23:43   ` Keshavamurthy Anil S
  -1 siblings, 0 replies; 4+ messages in thread
From: Keshavamurthy Anil S @ 2005-06-23 23:43 UTC (permalink / raw)
  To: Rusty Lynch; +Cc: Andrew Morton, linux-kernel, linux-ia64

On Wed, Jun 22, 2005 at 07:32:42PM -0700, Rusty Lynch wrote:
> 
>    +
>    +       if (slot == 1) {
Rusty, this is wrong. You should fail only
	if (slot == 1) && (bundle_encoding[template][1] != L) {
This is because for MLX template we will actually be patching
the instruction on slot = 2 and not on slot 1.
>    +               printk(KERN_WARNING "Inserting kprobes on slot #1 "
>    +                      "is not supported\n");
>    +               return -EINVAL;
>    +       }
>    +
>            return 0;
>     }
> 

-Anil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ia64][patch] Refuse inserting kprobe on slot 1
@ 2005-06-23 23:43   ` Keshavamurthy Anil S
  0 siblings, 0 replies; 4+ messages in thread
From: Keshavamurthy Anil S @ 2005-06-23 23:43 UTC (permalink / raw)
  To: Rusty Lynch; +Cc: Andrew Morton, linux-kernel, linux-ia64

On Wed, Jun 22, 2005 at 07:32:42PM -0700, Rusty Lynch wrote:
> 
>    +
>    +       if (slot = 1) {
Rusty, this is wrong. You should fail only
	if (slot = 1) && (bundle_encoding[template][1] != L) {
This is because for MLX template we will actually be patching
the instruction on slot = 2 and not on slot 1.
>    +               printk(KERN_WARNING "Inserting kprobes on slot #1 "
>    +                      "is not supported\n");
>    +               return -EINVAL;
>    +       }
>    +
>            return 0;
>     }
> 

-Anil

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-06-23 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-23  2:32 [ia64][patch] Refuse inserting kprobe on slot 1 Rusty Lynch
2005-06-23  2:32 ` Rusty Lynch
2005-06-23 23:43 ` Keshavamurthy Anil S
2005-06-23 23:43   ` Keshavamurthy Anil S

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.