Skip to content

Commit

Permalink
kprobes: refuse kprobe insertion on add/sub_preempt_counter()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Srinivasa Ds authored and Linus Torvalds committed Feb 24, 2008
1 parent 0835ab5 commit 4362758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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?
Expand Down

0 comments on commit 4362758

Please sign in to comment.