public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix possible race with 4level-fixup.h
Date: Thu, 17 Feb 2005 19:40:48 +1100	[thread overview]
Message-ID: <1108629648.5425.73.camel@gaston> (raw)
In-Reply-To: <421456F1.6090100@yahoo.com.au>

On Thu, 2005-02-17 at 19:33 +1100, Nick Piggin wrote:
> Benjamin Herrenschmidt wrote:
> > Hi !
> > 
> > When using 4level-fixup.h, a PMD page may end up beeing freed before the
> > matching PGD entry is cleared due to the way the compatibility macros
> > work. This can cause nasty races on some architectures.
> > 
> > This patch fixes it by defining pud_clear() to be pgd_clear(). That
> > means we'll actually write 0 twice, a small price to pay here,
> > especially seeing how easy it is to convert to the new headers anyway
> > (hint hint, ppc & ppc64 patches as soon as 2.6.11 is out).
> > 
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > 
> > Index: linux-work/include/asm-generic/4level-fixup.h
> > ===================================================================
> > --- linux-work.orig/include/asm-generic/4level-fixup.h	2005-01-24 17:09:49.000000000 +1100
> > +++ linux-work/include/asm-generic/4level-fixup.h	2005-02-17 18:10:38.000000000 +1100
> > @@ -24,7 +24,7 @@
> >  #define pud_bad(pud)			0
> >  #define pud_present(pud)		1
> >  #define pud_ERROR(pud)			do { } while (0)
> > -#define pud_clear(pud)			do { } while (0)
> > +#define pud_clear(pud)			pgd_clear((pgd_t *)(pud))
> >  
> 
> Just a small nit - no cast needed here.

Well, do you know ? pud is a pud_t* and the arch is free to implement
pgd_clear as an inline with strong typing no ? 

Ben.



  reply	other threads:[~2005-02-17  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17  7:19 [PATCH] Fix possible race with 4level-fixup.h Benjamin Herrenschmidt
2005-02-17  8:33 ` Nick Piggin
2005-02-17  8:40   ` Benjamin Herrenschmidt [this message]
2005-02-17  9:00     ` Nick Piggin

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=1108629648.5425.73.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@osdl.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