Thread (6 messages) 6 messages, 3 authors, 2011-08-09

kallsyms_lookup_name

flat view

From: Venkatram Tummala <hidden>
Date: 2011-08-08 04:52:47

On Sun, Aug 7, 2011 at 4:03 PM, Abu Rasheda [off-list ref] wrote:

On Sat, Aug 6, 2011 at 11:06 AM, Mulyadi Santosa <
mulyadi.santosa at gmail.com> wrote:
quoted
On Sat, Aug 6, 2011 at 12:55, Venkatram Tummala [off-list ref]
wrote:
quoted
Hi,

I need to use some unexported kernel symbols in my kernel module but in
the
quoted
particular kernel version i am based on (2.6.18 - RHEL 5.7),
kallsyms_lookup_name is not exported and there is no
kallsyms_on_each_symbol
quoted
in this kernel. And I can't change the kernel owing to reasons i have no
control over.

In this scenario, how do i use unexported symbols. Is there any other
mechanism by which i can lookup the address of a kernel symbol.
You can:

- grep kallsyms_lookup from /proc/kallsyms (it is there on SL 5.5 and SL
6.0. You can edit your program and assign something like:

int (*my_kallsyms_lookup_name)(const char *name) = (void *) KALLSYMS;

where KALLSYMS is address found above, or your loading script can feed this
address.
This is what i am currently doing but i need a cleaner way of doing this.

if your kernel is compiled with kprobe, you can use it to get address too.
How do i do it using kprobes? To register a kprobe, i need the address of
kallsyms_lookup_name which is what i want in the first place.

Venkatram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110807/1cfb184c/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help