Commit 95f715b08fa4a953771398d20cbe35a6803ea41d

Authored by Heiko Carstens
Committed by Benjamin Herrenschmidt
1 parent 0b5381a618

powerpc: Fix __get_user_pages_fast() irq handling

__get_user_pages_fast() may be called with interrupts disabled (see e.g.
get_futex_key() in kernel/futex.c) and therefore should use local_irq_save()
and local_irq_restore() instead of local_irq_disable()/enable().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
CC: <stable@vger.kernel.org> [v3.12]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

arch/powerpc/mm/gup.c
... ... @@ -123,6 +123,7 @@
123 123 struct mm_struct *mm = current->mm;
124 124 unsigned long addr, len, end;
125 125 unsigned long next;
  126 + unsigned long flags;
126 127 pgd_t *pgdp;
127 128 int nr = 0;
128 129  
... ... @@ -156,7 +157,7 @@
156 157 * So long as we atomically load page table pointers versus teardown,
157 158 * we can follow the address down to the the page and take a ref on it.
158 159 */
159   - local_irq_disable();
  160 + local_irq_save(flags);
160 161  
161 162 pgdp = pgd_offset(mm, addr);
162 163 do {
... ... @@ -179,7 +180,7 @@
179 180 break;
180 181 } while (pgdp++, addr = next, addr != end);
181 182  
182   - local_irq_enable();
  183 + local_irq_restore(flags);
183 184  
184 185 return nr;
185 186 }