Re: Altering normal kernel path execution from module?

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

 



On Fri, 2007-05-25 at 19:45 +0530, pradeep singh wrote:
> On 5/25/07, Avishay Traeger <atraeger@xxxxxxxxxxxxx> wrote:
> > On Fri, 2007-05-25 at 15:21 +0200, Erik Mouw wrote:
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > On Fri, May 25, 2007 at 05:53:14PM +0530, pradeep singh wrote:
> > > > Can we alter the normal kernel execution path using a kernel module?
> > > >
> > > > e.g
> > > > a()->b()->c()->d()->e()->f()->g()
> > > >
> > > > Without changing the existing kernel code, using only a loadable
> > > > module can i change the path of execution like
> > > >
> > > > a()->b()->mymethod()->f()->mymethod2()->g()
> > > >
> > > > Does anybody have idea if this can be done using a loadable module?
> > >
> > > You can't safely randomly patch code in a running kernel.
> >
> > What about using kprobes?
> Avishay, i do not need a debugger.
> I mean using a normal kernel module.
> Is this possible?
> Erik's reply suggests it is indeed.
> Any help?

I have never used kprobes, but from what I have read, it seems that you
can insert your own code at any point in the kernel.  Debugging is a
great use of this, but it isn't limited to that.  For example, I think
you can add a kprobe to the beginning of c() that calls mymethod().

If kprobes doesn't do what you need, you can also try kerninst:
http://www.paradyn.org/html/kerninst.html
I haven't tried this one either, so I can't speak for how stable it is,
but it's another dynamic instrumentation toolkit for the kernel.

Avishay


--
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