linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Dave McCracken <dmccr@us.ibm.com>
Cc: Andrew Morton <akpm@digeo.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.5.66-mm2] Fix page_convert_anon locking issues
Date: Thu, 3 Apr 2003 00:59:09 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0304030053240.1279-100000@localhost.localdomain> (raw)
In-Reply-To: <110950000.1049326945@baldur.austin.ibm.com>

On Wed, 2 Apr 2003, Dave McCracken wrote:
> --On Wednesday, April 02, 2003 15:38:45 -0800 Andrew Morton
> <akpm@digeo.com> wrote:
> 
> > But:
> > 
> > +	/* Double check to make sure the pte page hasn't been freed */
> > +	if (!pmd_present(*pmd))
> > +		goto out_unmap;
> > +
> > 	==> munmap, pte page is freed, reallocated for pagecache, someone
> > 	    happens to write the correct value into it.
> > 	
> > +	if (page_to_pfn(page) != pte_pfn(*pte))
> > +		goto out_unmap;
> > +
> > +	if (addr)
> > +		*addr = address;
> > +
> 
> Oops.  The pmd_present() check should be after the page_to_pfn() !=
> pte_pfn() check.

No, you're forgetting that the case Andrew rightly indicates is
covered by the ptecount check I added to page_convert_anon, and
commented at length there.  As I said yesterday, I don't think
this "Double check" on *pmd serves any real purpose as coded
(whereas the earlier "Double check" on *pgd is vital).

Hugh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

  parent reply	other threads:[~2003-04-02 23:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02 17:13 Dave McCracken
2003-04-02 21:29 ` Andrew Morton
2003-04-02 21:56   ` Dave McCracken
2003-04-02 23:09     ` Andrew Morton
2003-04-02 23:23       ` Dave McCracken
2003-04-02 23:38         ` Andrew Morton
2003-04-02 23:42           ` Dave McCracken
2003-04-02 23:52             ` Andrew Morton
2003-04-02 23:58               ` Dave McCracken
2003-04-03 14:49                 ` Dave McCracken
2003-04-03 15:38                   ` Hugh Dickins
2003-04-03 16:00                     ` Dave McCracken
2003-04-03 16:33                       ` Hugh Dickins
2003-04-03 16:39                         ` Dave McCracken
2003-04-03 20:00                   ` Andrew Morton
2003-04-03 20:06                   ` Andrew Morton
2003-04-03 20:56                     ` Andrew Morton
2003-04-03 21:01                       ` Dave McCracken
2003-04-02 23:59             ` Hugh Dickins [this message]
2003-04-03  0:06         ` Hugh Dickins

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=Pine.LNX.4.44.0304030053240.1279-100000@localhost.localdomain \
    --to=hugh@veritas.com \
    --cc=akpm@digeo.com \
    --cc=dmccr@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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