On Thu, 2010-08-19 at 14:31 -0700, Andrew Morton wrote:
Ah, I should add a:
WARN_ON_ONCE(in_irq() && !irqs_disabled());
like check to ensure people don't use kmap_atomic() in nestable IRQ
contexts (nestable IRQ context is bad anyway) the old debug code I
deleted did something similar.
+#ifdef CONFIG_DEBUG_HIGHMEM
+ BUG_ON(idx > KM_TYPE_NR);
+#endif
Seems to be that.
Right, so I currently have:
- stack size check in push/pop
- proper nesting check in pop (verifies that the vaddr you try to
unmap is indeed the top most on the stack)
Aside from the proposed no irq-nesting thing to avoid unbounded
recursion I can't really come up with more creative abuse.
Ah, that's a nifty trick, let me try that.
--