Re: How can I verify a memory address exist?

From: Vamsi Krishna S . (vamsi@in.ibm.com)
Date: Wed Nov 13 2002 - 03:13:42 EST


On Wed, Nov 13, 2002 at 12:48:44AM +0000, Rusty Lynch wrote:
> Is there a kernel function to find out if a given memory address exist?
>
I think you are trying to validate addresses to be passed into kprobes.
In that context, you need to check if the given address is a kernel
space code address.

Take a look at kernel_text_address() functions in
arch/i386/kernel/traps.c which do this. Unfortunately, they are defined
static inline, so, they can't be used outside of traps.c. You may
want to export that function from kernel and use it in your driver.

Cheers,
Vamsi.

-- 
Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: vamsi@in.ibm.com
-
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/



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