public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 3/7] kprobes: Add __kprobes to kprobe internal functions
@ 2008-11-11 20:58 Masami Hiramatsu
  2008-11-12 15:57 ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2008-11-11 20:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ananth N Mavinakayanahalli, Jim Keniston, David Miller, LKML,
	systemtap-ml, Rusty Russell, Srinivasa Ds

Add __kprobes to kprobes internal functions for protecting
from probing by kprobes itself.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
---
 kernel/kprobes.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

This patch is required for the patch 5/7.

Index: 2.6.28-rc4/kernel/kprobes.c
===================================================================
--- 2.6.28-rc4.orig/kernel/kprobes.c
+++ 2.6.28-rc4/kernel/kprobes.c
@@ -410,7 +410,7 @@ void __kprobes recycle_rp_inst(struct kr
 		hlist_add_head(&ri->hlist, head);
 }

-void kretprobe_hash_lock(struct task_struct *tsk,
+void __kprobes kretprobe_hash_lock(struct task_struct *tsk,
 			 struct hlist_head **head, unsigned long *flags)
 {
 	unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS);
@@ -421,13 +421,15 @@ void kretprobe_hash_lock(struct task_str
 	spin_lock_irqsave(hlist_lock, *flags);
 }

-static void kretprobe_table_lock(unsigned long hash, unsigned long *flags)
+static void __kprobes kretprobe_table_lock(unsigned long hash,
+	unsigned long *flags)
 {
 	spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash);
 	spin_lock_irqsave(hlist_lock, *flags);
 }

-void kretprobe_hash_unlock(struct task_struct *tsk, unsigned long *flags)
+void __kprobes kretprobe_hash_unlock(struct task_struct *tsk,
+	unsigned long *flags)
 {
 	unsigned long hash = hash_ptr(tsk, KPROBE_HASH_BITS);
 	spinlock_t *hlist_lock;
@@ -436,7 +438,7 @@ void kretprobe_hash_unlock(struct task_s
 	spin_unlock_irqrestore(hlist_lock, *flags);
 }

-void kretprobe_table_unlock(unsigned long hash, unsigned long *flags)
+void __kprobes kretprobe_table_unlock(unsigned long hash, unsigned long *flags)
 {
 	spinlock_t *hlist_lock = kretprobe_table_lock_ptr(hash);
 	spin_unlock_irqrestore(hlist_lock, *flags);
@@ -762,7 +764,7 @@ static void __kprobes __unregister_kprob
 	}
 }

-static int __register_kprobes(struct kprobe **kps, int num,
+static int __kprobes __register_kprobes(struct kprobe **kps, int num,
 	unsigned long called_from)
 {
 	int i, ret = 0;
@@ -828,7 +830,7 @@ unsigned long __weak arch_deref_entry_po
 	return (unsigned long)entry;
 }

-static int __register_jprobes(struct jprobe **jps, int num,
+static int __kprobes __register_jprobes(struct jprobe **jps, int num,
 	unsigned long called_from)
 {
 	struct jprobe *jp;
@@ -990,7 +992,7 @@ static int __kprobes __register_kretprob
 	return ret;
 }

-static int __register_kretprobes(struct kretprobe **rps, int num,
+static int __kprobes __register_kretprobes(struct kretprobe **rps, int num,
 	unsigned long called_from)
 {
 	int ret = 0, i;

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* Re: [PATCH 3/7] kprobes: Add __kprobes to kprobe internal functions
  2008-11-11 20:58 [PATCH 3/7] kprobes: Add __kprobes to kprobe internal functions Masami Hiramatsu
@ 2008-11-12 15:57 ` Ananth N Mavinakayanahalli
  0 siblings, 0 replies; 2+ messages in thread
From: Ananth N Mavinakayanahalli @ 2008-11-12 15:57 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Andrew Morton, Jim Keniston, David Miller, LKML, systemtap-ml,
	Rusty Russell, Srinivasa Ds

On Tue, Nov 11, 2008 at 03:56:40PM -0500, Masami Hiramatsu wrote:
> Add __kprobes to kprobes internal functions for protecting
> from probing by kprobes itself.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> ---
>  kernel/kprobes.c |   16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> This patch is required for the patch 5/7.

Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

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

end of thread, other threads:[~2008-11-12 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-11 20:58 [PATCH 3/7] kprobes: Add __kprobes to kprobe internal functions Masami Hiramatsu
2008-11-12 15:57 ` Ananth N Mavinakayanahalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).