Re: [RFC][PATCH 0/6] mm, highmem: kmap_atomic rework

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Friday, August 20, 2010 - 7:38 am

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. 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/6] mm, highmem: kmap_atomic rework, Peter Zijlstra, (Thu Aug 19, 1:13 pm)
[RFC][PATCH 1/6] mm: strictly nested kmap_atomic, Peter Zijlstra, (Thu Aug 19, 1:13 pm)
[RFC][PATCH 2/6] mm: stack based kmap_atomic, Peter Zijlstra, (Thu Aug 19, 1:13 pm)
[RFC][PATCH 3/6] mm, frv: Out-of-line kmap-atomic, Peter Zijlstra, (Thu Aug 19, 1:13 pm)
[RFC][PATCH 4/6] mm: Remove all KM_type arguments, Peter Zijlstra, (Thu Aug 19, 1:13 pm)
[RFC][PATCH 6/6] mm: Remove pte_*map_nested(), Peter Zijlstra, (Thu Aug 19, 1:13 pm)
Re: [RFC][PATCH 0/6] mm, highmem: kmap_atomic rework, Andrew Morton, (Thu Aug 19, 2:31 pm)
Re: [RFC][PATCH 0/6] mm, highmem: kmap_atomic rework, Peter Zijlstra, (Fri Aug 20, 7:38 am)
Re: [RFC][PATCH 1/6] mm: strictly nested kmap_atomic, Rik van Riel, (Fri Aug 20, 1:50 pm)
Re: [RFC][PATCH 2/6] mm: stack based kmap_atomic, Rik van Riel, (Fri Aug 20, 2:34 pm)
Re: [RFC][PATCH 4/6] mm: Remove all KM_type arguments, Rik van Riel, (Fri Aug 20, 2:44 pm)
Re: [RFC][PATCH 6/6] mm: Remove pte_*map_nested(), Rik van Riel, (Fri Aug 20, 2:47 pm)
Re: [RFC][PATCH 3/6] mm, frv: Out-of-line kmap-atomic, Rik van Riel, (Fri Aug 20, 2:48 pm)
Re: [RFC][PATCH 1/6] mm: strictly nested kmap_atomic, KAMEZAWA Hiroyuki, (Tue Aug 24, 12:09 am)
Re: [RFC][PATCH 2/6] mm: stack based kmap_atomic, KAMEZAWA Hiroyuki, (Tue Aug 24, 12:24 am)