Re: Dynamic Kernel Module Section Addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 27, 2010 at 11:58 PM, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote:
Hey Venkatram,

On Wed, Apr 28, 2010 at 11:33 AM, Venkatram Tummala <venkatram867@xxxxxxxxx> wrote:
to find these addresses by "p modules", the module has to be already loaded.....right? So, the initialization function of the module must have been  already executed....right? So, the question is how can we step through the initialization function of the module..? "p modules" won't help us..probably looking at /sys is a faster way to find module segment addresses, or am I missing something here in "p modules"??


Why don't you try setting breakpoints in kernel (kernel/module.c) after the module has been loaded but before your modules' init function is called?

From kernel/module.c , in SYSCALL_DEFINE3(init_module..):
the line load_module(...) loads your module into the kernel, and  the line do_one_initcall(mod->init); calls the init functions.
So I think if you set a break point in between these lines, you should be able to get the address of text section etc just in time before the init functions is called, using p modules or something.

Hey Joel,

Yup, that is exactly the trick mentioned by Mulyadi in the previous post. Will try that & there is no reason why this won't work. This will definitely solve the problem.

Thanks Everybody,
Venkatram

-Joel



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux