<div class="gmail_quote">On Sun, Aug 7, 2011 at 4:03 PM, Abu Rasheda <span dir="ltr"><<a href="mailto:rcpilot2010@gmail.com">rcpilot2010@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div class="im">On Sat, Aug 6, 2011 at 11:06 AM, Mulyadi Santosa <span dir="ltr"><<a href="mailto:mulyadi.santosa@gmail.com" target="_blank">mulyadi.santosa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><div></div><div>On Sat, Aug 6, 2011 at 12:55, Venkatram Tummala <<a href="mailto:venkatram867@gmail.com" target="_blank">venkatram867@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I need to use some unexported kernel symbols in my kernel module but in the<br>
> particular kernel version i am based on (2.6.18 - RHEL 5.7),<br>
> kallsyms_lookup_name is not exported and there is no kallsyms_on_each_symbol<br>
> in this kernel. And I can't change the kernel owing to reasons i have no<br>
> control over.<br>
><br>
> In this scenario, how do i use unexported symbols. Is there any other<br>
> mechanism by which i can lookup the address of a kernel symbol.<br><br></div></div></blockquote></div><div><br>You can:<br><br>- 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:<br>
<br>int (*my_kallsyms_lookup_name)(const char *name) = (void *) KALLSYMS;<br><br>where KALLSYMS is address found above, or your loading script can feed this address. </div></div></blockquote><div> </div><div>This is what i am currently doing but i need a cleaner way of doing this. <br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div>if your kernel is compiled with kprobe, you can use it to get address too.<br>
</div></div></blockquote><div><br>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.<br><br>Venkatram <br></div></div><br>