aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmalloc.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index fb42a5bffe47..d4b2e34adae0 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -531,22 +531,21 @@ static void unmap_vmap_area(struct vmap_area *va)
531static void vmap_debug_free_range(unsigned long start, unsigned long end) 531static void vmap_debug_free_range(unsigned long start, unsigned long end)
532{ 532{
533 /* 533 /*
534 * Unmap page tables and force a TLB flush immediately if 534 * Unmap page tables and force a TLB flush immediately if pagealloc
535 * CONFIG_DEBUG_PAGEALLOC is set. This catches use after free 535 * debugging is enabled. This catches use after free bugs similarly to
536 * bugs similarly to those in linear kernel virtual address 536 * those in linear kernel virtual address space after a page has been
537 * space after a page has been freed. 537 * freed.
538 * 538 *
539 * All the lazy freeing logic is still retained, in order to 539 * All the lazy freeing logic is still retained, in order to minimise
540 * minimise intrusiveness of this debugging feature. 540 * intrusiveness of this debugging feature.
541 * 541 *
542 * This is going to be *slow* (linear kernel virtual address 542 * This is going to be *slow* (linear kernel virtual address debugging
543 * debugging doesn't do a broadcast TLB flush so it is a lot 543 * doesn't do a broadcast TLB flush so it is a lot faster).
544 * faster).
545 */ 544 */
546#ifdef CONFIG_DEBUG_PAGEALLOC 545 if (debug_pagealloc_enabled()) {
547 vunmap_page_range(start, end); 546 vunmap_page_range(start, end);
548 flush_tlb_kernel_range(start, end); 547 flush_tlb_kernel_range(start, end);
549#endif 548 }
550} 549}
551 550
552/* 551/*