2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 00:26:39 +08:00
linux-next/arch/sparc
Peter Zijlstra 20273941f2 mm: fix race in kunmap_atomic()
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.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Christoph Hellwig <hch@infradead.org>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:05 -07:00
..
boot Merge branch 'master' into for-next 2010-06-16 18:08:13 +02:00
configs defconfig reduction 2010-08-14 22:26:53 +02:00
include/asm mm: remove pte_*map_nested() 2010-10-26 16:52:08 -07:00
kernel Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-10-25 08:19:14 -07:00
lib sparc64: Make lock backoff really a NOP on UP builds. 2010-08-18 22:53:26 -07:00
math-emu Revert "endian: #define __BYTE_ORDER" 2010-05-26 08:30:15 -07:00
mm mm: fix race in kunmap_atomic() 2010-10-27 18:03:05 -07:00
oprofile sparc: using HZ needs an include of linux/param.h 2009-10-05 00:46:08 -07:00
prom Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-10-25 08:19:14 -07:00
Kconfig Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-10-25 08:19:14 -07:00
Kconfig.debug sparc: Kill user copy check code. 2010-08-09 00:45:46 -07:00
Makefile sparc: Set UTS_MACHINE correctly. 2009-12-05 17:17:55 -08:00