dma-api: Teach the "DMA-from-stack" check about vmapped stacks
authorAndy Lutomirski <luto@kernel.org>
Thu, 11 Aug 2016 09:35:22 +0000 (02:35 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 24 Aug 2016 10:11:41 +0000 (12:11 +0200)
commitb4a0f533e5976cb1a79f31d6152e1d322d79b7f1
tree152db464039f7cfe9a450f870d5293128c9bc513
parentba14a194a434ccc8f733e263ad2ce941e35e5787
dma-api: Teach the "DMA-from-stack" check about vmapped stacks

If we're using CONFIG_VMAP_STACK=y and we manage to point an sg entry
at the stack, then either the sg page will be in highmem or sg_virt()
will return the direct-map alias.  In neither case will the existing
check_for_stack() implementation realize that it's a stack page.

Fix it by explicitly checking for stack pages.

This has no effect by itself.  It's broken out for ease of review.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/448460622731312298bf19dcbacb1606e75de7a9.1470907718.git.luto@kernel.org
[ Minor edits. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
lib/dma-debug.c