mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: Srinivasa Ds <srinivasa@in.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jim Keniston <jkenisto@us.ibm.com>,
	linux-kernel@vger.kernel.org, srikar@linux.vnet.ibm.com
Subject: Re: [RFC] [PATCH] Refuse kprobe insertion on add/sub_preempt_counter()
Date: Wed, 20 Feb 2008 16:07:30 +0530	[thread overview]
Message-ID: <20080220103730.GA6689@in.ibm.com> (raw)
In-Reply-To: <200802201545.17986.srinivasa@in.ibm.com>

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/
> 

      reply	other threads:[~2008-02-20 10:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 10:15 Srinivasa Ds
2008-02-20 10:37 ` Ananth N Mavinakayanahalli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080220103730.GA6689@in.ibm.com \
    --to=ananth@in.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=srinivasa@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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