linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: Re: [RFT][PATCH] mm: Fix race in kunmap_atomic()
Date: Wed, 27 Oct 2010 13:46:47 -0400	[thread overview]
Message-ID: <4CC86587.6010506@redhat.com> (raw)
In-Reply-To: <1288191261.15336.1953.camel@twins>

On 10/27/2010 10:54 AM, Peter Zijlstra wrote:

> Christoph reported a nice splat which illustrated a race in the new
> stack based kmap_atomic implementation.
>
> The problem is that we pop our stack slot before we're completely done
> resetting its state -- in particular clearing the PTE (sometimes that's
> CONFIG_DEBUG_HIGHMEM). If an interrupt happens before we actually clear
> the PTE used for the last slot, that interrupt can reuse the slot in a
> dirty state, which triggers a BUG in kmap_atomic().
>
> Fix this by introducing kmap_atomic_idx() which reports the current slot
> index without actually releasing it and use that to find the PTE and
> delay the _pop() until after we're completely done.
>
> Reported-by: Christoph Hellwig<hch@infradead.org>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

--
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:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2010-10-27 17:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20101027125154.GA23679@infradead.org>
2010-10-27 14:54 ` [RFT][PATCH] mm: Fix race in kunmap_atomic() Peter Zijlstra
2010-10-27 17:46   ` Rik van Riel [this message]

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=4CC86587.6010506@redhat.com \
    --to=riel@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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).