linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: ming lei <mlei30@yahoo.com>
To: Dan Malek <dan@embeddededge.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: double kernel page table entry for the same physical page?!
Date: Wed, 13 Jul 2005 18:57:03 -0700 (PDT)	[thread overview]
Message-ID: <20050714015703.34280.qmail@web61015.mail.yahoo.com> (raw)
In-Reply-To: <17068cbdcbb1e2de531d33eb07f768e5@embeddededge.com>

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:
> 
> > Why linux kernel does such thing and no one
> consider
> > 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 

  reply	other threads:[~2005-07-14  1:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-13 20:10 double kernel page table entry for the same physical page?! ming lei
2005-07-13 21:27 ` Dan Malek
2005-07-13 21:48   ` ming lei
2005-07-13 22:36     ` Dan Malek
2005-07-14  1:57       ` ming lei [this message]
2005-07-14  7:15         ` Pantelis Antoniou

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=20050714015703.34280.qmail@web61015.mail.yahoo.com \
    --to=mlei30@yahoo.com \
    --cc=dan@embeddededge.com \
    --cc=linuxppc-embedded@ozlabs.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;
as well as URLs for NNTP newsgroup(s).