Thread (6 messages) flat view 6 messages, 3 authors, 2005-07-14

Re: double kernel page table entry for the same physical page?!

From: ming lei <hidden>
Date: 2005-07-14 01:57:05

Dan,

No one intents to make memory corruption in kernel
space but it happens sometimes.

Say I have a global var in my kernel module which
called test-mod, it picks up a physical page allocated
by some code with  kmalloc and later kfreed(suppose
when it does, the whole page gets freed). But then
this code forgets a pointer(which maped to this
physical page) already freed and modifies the pointer,
the write gets thru since that virt address's PTE
still valid and points to the physical page currently
used by test-mod. So the memory corruption happens.

Maybe I miss something in the linux kernel code that
prevents this double PTE thing.

Ming
--- Dan Malek <dan@embeddededge.com> wrote:
On Jul 13, 2005, at 2:48 PM, ming lei wrote:
quoted
Why linux kernel does such thing and no one
consider
quoted
it's a problem?
Because we don't write software that accesses the
memory
from both of those locations, unless it is very
intentional
and necessary.  If you are just fishing for ways
software
_could_ do bad things, there are tons of them.  It's
our
job to write it so it doesn't :-)

Thanks.


	-- Dan


		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help