Re: [PATCH] kprobes for 2.5.47

From: Vamsi Krishna S . (
Date: Wed Nov 13 2002 - 02:22:33 EST

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.


Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Nov 15 2002 - 22:00:28 EST