Re: Using module private memory to simulate microkernel's memoryprotection

From: Ingo Molnar
Date: Wed Feb 11 2009 - 10:25:28 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> * Pengfei Hu <hpfei.cn@xxxxxxxxx> wrote:
>
> > >
> > > Hm, are you aware of the kmemcheck project?
> > >
> > > Ingo
> > >
> >
> > Frankly, I only know this project's name. Just when I nearly finished
> > this patch, I browsed http://git.kernel.org/ first time. I am only a
> > beginner in Linux kernel. Maybe I should first discuss before write
> > code. But I think it is not too late.
> >
> > Can you tell me more about this project? I realy appreciate it.
>
> Sure:

More info: kmemcheck was written by Vegard Nossum (and released more than
a year ago) and it uses similar principles as your patch: it enforces
memory usage constraints via pagetable access bits.

More description about kmemcheck can be found in the following LWN article:

http://lwn.net/Articles/260068/

I think your idea of limiting execution to individual modules could perhaps
be combined with kmemcheck. It's the same general principle.

The difference is that your patch calls back from the page fault handler and
modifies the monitored pte's to present, brings in a TLB and then it modifies
it to not present. So the page can be accessed up until the TLB gets flushed.

Kmemcheck uses debug traps to execute a single instruction, and thus gets
finer grained control of what is visible to a task.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/