lkml.org 
[lkml]   [2007]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC] [patch 2/2] Refuse kprobe insertion on __init section code
Date
This patch makes use of non_init_kernel_text_address() to avoid
probing __init functions.

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>


---
kernel/kprobes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.24-rc5-mm1/kernel/kprobes.c
===================================================================
--- linux-2.6.24-rc5-mm1.orig/kernel/kprobes.c
+++ linux-2.6.24-rc5-mm1/kernel/kprobes.c
@@ -520,7 +520,7 @@ static int __kprobes __register_kprobe(s
return -EINVAL;
p->addr = (kprobe_opcode_t *)(((char *)p->addr)+ p->offset);

- if (!kernel_text_address((unsigned long) p->addr) ||
+ if (!non_init_kernel_text_address((unsigned long) p->addr) ||
in_kprobes_functions((unsigned long) p->addr))
return -EINVAL;

@@ -662,7 +662,7 @@ int __kprobes register_jprobe(struct jpr
{
unsigned long addr = arch_deref_entry_point(jp->entry);

- if (!kernel_text_address(addr))
+ if (!non_init_kernel_text_address(addr))
return -EINVAL;

/* Todo: Verify probepoint is a function entry point */

\
 
 \ /
  Last update: 2007-12-14 07:59    [W:0.063 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site