linux/include
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
..
acpi Merge branch 'misc' into release 2010-10-26 14:51:00 -04:00
asm-generic vmlinux.lds.h: lower init ramfs alignment to 4 2010-10-26 16:52:13 -07:00
crypto Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
drm Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next 2010-10-26 09:23:22 +10:00
keys
linux mm: fix race in kunmap_atomic() 2010-10-27 18:03:05 -07:00
math-emu
media Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-10-25 07:59:01 -07:00
mtd
net
pcmcia
rdma IB/core: Add VLAN support for IBoE 2010-10-25 10:20:39 -07:00
rxrpc
scsi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2010-10-26 17:54:22 -07:00
sound Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-10-25 08:32:05 -07:00
trace writeback: do not sleep on the congestion queue if there are no congested BDIs or if significant congestion is not being encountered in the current zone 2010-10-26 16:52:07 -07:00
video Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-10-25 08:32:05 -07:00
xen Merge branches 'upstream/xenfs' and 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen 2010-10-26 18:20:19 -07:00
Kbuild