mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] [PATCH] Refuse kprobe insertion on add/sub_preempt_counter()
@ 2008-02-20 10:15 Srinivasa Ds
  2008-02-20 10:37 ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivasa Ds @ 2008-02-20 10:15 UTC (permalink / raw)
  To: Andrew Morton, ananth, Jim Keniston, linux-kernel, srikar

Kprobes makes use of preempt_disable(),preempt_enable_noresched() and these
functions inturn call add/sub_preempt_count(). So we need to refuse user from 
inserting probe in to these functions. 

This patch disallows user from probing add/sub_preempt_count(). 

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>


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

Index: linux-2.6.25-rc2/kernel/sched.c
===================================================================
--- linux-2.6.25-rc2.orig/kernel/sched.c
+++ linux-2.6.25-rc2/kernel/sched.c
@@ -3766,7 +3766,7 @@ void scheduler_tick(void)
 
 #if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT)
 
-void add_preempt_count(int val)
+void __kprobes add_preempt_count(int val)
 {
 	/*
 	 * Underflow?
@@ -3782,7 +3782,7 @@ void add_preempt_count(int val)
 }
 EXPORT_SYMBOL(add_preempt_count);
 
-void sub_preempt_count(int val)
+void __kprobes sub_preempt_count(int val)
 {
 	/*
 	 * Underflow?



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

* Re: [RFC] [PATCH] Refuse kprobe insertion on add/sub_preempt_counter()
  2008-02-20 10:15 [RFC] [PATCH] Refuse kprobe insertion on add/sub_preempt_counter() Srinivasa Ds
@ 2008-02-20 10:37 ` Ananth N Mavinakayanahalli
  0 siblings, 0 replies; 2+ messages in thread
From: Ananth N Mavinakayanahalli @ 2008-02-20 10:37 UTC (permalink / raw)
  To: Srinivasa Ds; +Cc: Andrew Morton, Jim Keniston, linux-kernel, srikar

On Wed, Feb 20, 2008 at 03:45:17PM +0530, Srinivasa Ds wrote:
> Kprobes makes use of preempt_disable(),preempt_enable_noresched() and these
> functions inturn call add/sub_preempt_count(). So we need to refuse user from 
> inserting probe in to these functions. 
> 
> This patch disallows user from probing add/sub_preempt_count(). 
> 
> Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>

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

> ---
>  kernel/sched.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.25-rc2/kernel/sched.c
> ===================================================================
> --- linux-2.6.25-rc2.orig/kernel/sched.c
> +++ linux-2.6.25-rc2/kernel/sched.c
> @@ -3766,7 +3766,7 @@ void scheduler_tick(void)
> 
>  #if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT)
> 
> -void add_preempt_count(int val)
> +void __kprobes add_preempt_count(int val)
>  {
>  	/*
>  	 * Underflow?
> @@ -3782,7 +3782,7 @@ void add_preempt_count(int val)
>  }
>  EXPORT_SYMBOL(add_preempt_count);
> 
> -void sub_preempt_count(int val)
> +void __kprobes sub_preempt_count(int val)
>  {
>  	/*
>  	 * Underflow?
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

end of thread, other threads:[~2008-02-20 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 10:15 [RFC] [PATCH] Refuse kprobe insertion on add/sub_preempt_counter() Srinivasa Ds
2008-02-20 10:37 ` 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

Powered by JetHome