Re: How can I verify a memory address exist?

Vamsi Krishna S . (vamsi@in.ibm.com)
Wed, 13 Nov 2002 13:43:42 +0530


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/