Re: [PATCH] 2.6.27: add a kernel hacking option to protect kernel memory between different modules

From: Pengfei Hu
Date: Mon Nov 03 2008 - 08:59:16 EST


>
> And your solution is to create a large slowdown, which will just make them
> look for ways to make it go faster... perhaps including even *more* stupid-crazy
> kernel thread tricks?
>

Maybe you don't like it, but it is true. My company's product use
linux but most of
programmer even don'nt knot splin lock. There are many bugs in their code. It is
nessary to avoid mistiake automaticly. My patch is just a kernel
hacking option and
it won't slowdonw kernel in release version. How do you think
CONFIG_DEBUG_PAGEALLOC,
it also slowdonw kernel. And if you ever used bounds checker or valgrind, they
slowdown even worse.

> Can you point at any bugs/failure modes that this patch would detect, but
> would *not* be found by any of the already-existing memory debugging tools?

You know the worst bug of memory allocation is dangling pointer if tow module
use one allocator. Although there are some tool can detect this bug, but all of
them works in user space. They can use in kernel.

> Is it at all sane to expect that a reasonable setting can be done for
> things like slab and vmalloc? What happens when multiple modules allocate
> out of the same slab, or even worse, get vmalloc/kmalloc for *different*
> things on the same physical page? It seems that unless you can separate
> memory allocations by module, this isn't going to provide a lot of help in
> finding memory allocation/usage issues.
>

I want to let every registered module use it own caches just like
general caches.
The unit of vmalloc's size is page, so it won't have any trouble. The
protection must
work on page. I know the current code of kernel doesn't need this "private page"
feature. But maybe in the future it will get some help. And this
feature is compitable
with the current "globle page". It just like kernel support
SCHED_FIFO. Do you think
SCHED_FIFO is helpful to normal linux system?
--
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/