public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Vamsi Krishna S ." <vamsi@in.ibm.com>
To: Rusty Lynch <rusty@linux.co.intel.com>
Cc: rusty@rustcorp.com.au, lkml <linux-kernel@vger.kernel.org>,
	rddunlap@osdl.org, richard <richardj_moore@uk.ibm.com>,
	tom <hanrahat@us.ibm.com>
Subject: Re: [PATCH] kprobes for 2.5.47
Date: Wed, 13 Nov 2002 12:52:33 +0530	[thread overview]
Message-ID: <20021113125233.A3135@in.ibm.com> (raw)
In-Reply-To: <004b01c28ab8$2f89a2c0$77d40a0a@amr.corp.intel.com>; from rusty@linux.co.intel.com on Tue, Nov 12, 2002 at 05:58:39PM -0800

On Tue, Nov 12, 2002 at 05:58:39PM -0800, Rusty Lynch wrote:
> When register_kprobe() is called with a bad addr, we crash the kernel.
> Should it be the reponsibility of the caller, or the kernel to make sure the
> addr is ok?
> 
kprobes is an in-kernel low-level interface for placing probes. The user
of the interface is going to be the kernel itself or a kernel module. It
is the responsibility of the caller (which too is in kernel space) to 
ensure that:

- register_kprobe is called with a valid address
- that address is at the beginning of an instruction.

So, IMO these address checks don't belong in register_kprobe.

> BTW, I have a stupid little sample char driver that reads in address/message
> pairs and then adds a probe that printk's the message at the address.  This
> was just my way of learning how to use kprobes.  Should I post it?  I would
> love to get feedback on what I did wrong, but I hate to spam the list.
> 
This driver gets input (address to put probe at) from user, like all user 
this address needs to be validated, in this driver. I am writing a kernel
module on top of kprobes that interacts with the user and provides 
higher level of functionality (similar to dprobes) than what is provided 
by the raw kprobes interface. It is in this module that all the user input
including addresses are validated before calling register_kprobe.

Regards,
Vamsi.
-- 
Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: vamsi@in.ibm.com

      parent reply	other threads:[~2002-11-13  7:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-12 11:20 [PATCH] kprobes for 2.5.47 Vamsi Krishna S .
2002-11-13  1:58 ` Rusty Lynch
2002-11-13  3:08   ` Randy.Dunlap
2002-11-13  4:15     ` Rusty Lynch
2002-11-13  7:22   ` Vamsi Krishna S . [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=20021113125233.A3135@in.ibm.com \
    --to=vamsi@in.ibm.com \
    --cc=hanrahat@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    --cc=richardj_moore@uk.ibm.com \
    --cc=rusty@linux.co.intel.com \
    --cc=rusty@rustcorp.com.au \
    /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