Re: Dynamic Kernel Module Section Addresses

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

 



On Wed, Apr 28, 2010 at 11:33 AM, Venkatram Tummala
<venkatram867@xxxxxxxxx> wrote:
> On Tue, Apr 27, 2010 at 8:01 PM, Manish Katiyar <mkatiyar@xxxxxxxxx> wrote:
>>
>> On Wed, Apr 28, 2010 at 6:38 AM, Venkatram Tummala
>> <venkatram867@xxxxxxxxx> wrote:
>> > On Tue, Apr 27, 2010 at 5:04 PM, Mulyadi Santosa
>> > <mulyadi.santosa@xxxxxxxxx>
>> > wrote:
>> >>
>> >> Hi Venkatram...
>> >>
>> >> On Wed, Apr 28, 2010 at 05:34, Venkatram Tummala
>> >> <venkatram867@xxxxxxxxx>
>> >> wrote:
>> >> >
>> >> > 1) Is there any way to tell the kernel not to load these module
>> >> > sections
>> >> > at
>> >> > different addresses every time the module is inserted & removed .
>> >> > That
>> >> > is,
>> >> > can we have the module loaded at exactly the same address everytime?
>> >>
>> >> None that I know. AFAIK the only way is to recheck the /sys entry and
>> >> reinsert the symbol file (your kernel module file, which has been
>> >> compiled with -g before) to proper position
>> >
>> > With this approach, i can set breakpoints in every function except for
>> > the
>> > function that initializes the module because i have to insert the module
>> > to
>> > get the kernel module section addresses from /sys  as a result of which,
>> > the
>> > initializition routine finishes executing which means i can not set any
>> > breakpoints in the module initialize function.
>> >
>> > This is not a problem for the the module exit function or any other
>> > function
>> > though.
>> >
>> > There should be a way to tell the kernel that "Look, I dont care where
>> > you
>> > put the segments of this module but put them at the same place everytime
>> > i
>> > re-insert the module again (atleast until the next reboot)".
>> > Conceptually,
>> > this should not be hard to implement (if its not there already) because
>> > it
>> > is the same kernel & the same unchanged KO module that i am asking it to
>> > insert.
>> >>
>> >> > 2) Is there any way to overcome this problem so that i can debug the
>> >> > module
>> >> > using vmware even though the module is loaded at different addresses?
>>
>> Probably i didn't understand the question. Can't you find it by
>> looking at "p modules" from gdb ?
>
> Hey Manish,
>
> 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..?
Yes, you can't step through initialization function using this.

Thanks -
Manish
>  "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"??
>
> I will try out Mulyadi's trick & get back !
>
> Regards,
> Venkatram Tummala
>>
>> Thanks -
>> Manish
>>
>>
>> >>
>> >> AFAIK, again none that I know.
>> >>
>> >> --
>> >> regards,
>> >>
>> >> Mulyadi Santosa
>> >> Freelance Linux trainer and consultant
>> >>
>> >> blog: the-hydra.blogspot.com
>> >> training: mulyaditraining.blogspot.com
>> >
>> >
>>
>>
>>
>> --
>> Thanks -
>> Manish
>> ==================================
>> [$\*.^ -- I miss being one of them
>> ==================================
>
>



-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[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