Discussion:
insert code into kernel space
(demasiado antiguo para responder)
yueqiang
2010-10-12 01:26:03 UTC
Permalink
Hi:
I'm working on a security project. In this project, I need insert a
batch of function, like a function pool, into kernel space. Here I
have two questions about this:
1: how can we make sure the code compatible with current kernel image.
Of course, we can build it like Loadable kernel module. But if we do
in this way, the second question comes up.

2: Loadable Kernel Module is dynamic linked. means some function call
address is filled when kernel load the module into kernel space.
However, in our project, we need the function pool work during booting
time (after the init.text functions). In this process, we can not use
insmod or modprobe to load LKM (Am I right about this?)

Is there any other ways to get compatible code? and How to insert
compatible code into kernel space during kernel boots up.

yueqiang
yueqiang
2010-10-12 01:32:40 UTC
Permalink
   I'm working on a security project. In this project, I need insert a
batch of function, like a function pool, into kernel space. Here I
1: how can we make sure the code compatible with current kernel image.
Of course, we can build it like Loadable kernel module. But if we do
in this way, the second question comes up.
2: Loadable Kernel Module is dynamic linked. means some function call
address is filled when kernel load the module into kernel space.
However, in our project, we need the function pool work during booting
time (after the init.text functions). In this process, we can not use
insmod or modprobe to load LKM (Am I right about this?)
Is there any other ways to get compatible code? and How to insert
compatible code into kernel space during kernel boots up.
yueqiang
One thing should be mentioned. Kernel works on Hypervisor (Xen). when
Xen loads and builds kernel, I hope Xen also insert some code into
kernel space, and make sure the code compatible with kernel.

Yueqiang

Loading...