]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
kprobes: refuse kprobe insertion on add/sub_preempt_counter()
authorSrinivasa Ds <srinivasa@in.ibm.com>
Sat, 23 Feb 2008 23:24:04 +0000 (15:24 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 24 Feb 2008 01:13:24 +0000 (17:13 -0800)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sched.c

index f28f19e65b598af5dca9c8985af38febfaada9ff..c4bc8c2109589d399bc08df9977976d3b54d9876 100644 (file)
@@ -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?