From: Valdis.Kletnieks@vt.edu
To: Pengfei Hu <hpfei.cn@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.6.27: add a kernel hacking option to protect kernel memory between different modules
Date: Mon, 03 Nov 2008 07:29:39 -0500 [thread overview]
Message-ID: <67704.1225715379@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Sun, 02 Nov 2008 22:15:11 +0800." <a5f59d880811020615x297ff832kbce705d07318dfa2@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]
On Sun, 02 Nov 2008 22:15:11 +0800, Pengfei Hu said:
> efficiency and simplicity. But now more and more embed application use
> linux. In the traditional embed system, all the task run in kernel and
> share the memory. Using kernel thread can immigrate these application
> easily. So there will be many task run in the kernel.
So the target is embedded systems doing all sorts of stupid-crazy kernel
thread tricks...
> + Change page table's present flag to prevent other module's accidental
> + access. This results in a large slowdown and waste more memory, but
> + helps to find certain types of memory corruptions.
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?
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?
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.
And I won't even *start* on all the data structures in the kernel that are
shared across modules - do a 'cat /proc/slabinfo' or equivalent, and ask
yourself how many of those you could tag as "private to module A", or
"read/write by B, read-only by C, no-access by others".
You *really* don't want to re-invent the IBM MVS-style "GETMAIN/FREEMAIN SP=nnn"
mess. Trust me on this one. ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
next prev parent reply other threads:[~2008-11-03 12:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-02 14:15 Pengfei Hu
2008-11-03 12:29 ` Valdis.Kletnieks [this message]
2008-11-03 13:58 ` Pengfei Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67704.1225715379@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=hpfei.cn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®