Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'slab-for-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab

Pull slab fix from Vlastimil Babka:

- Fix mempool poisoning order>0 pages with CONFIG_HIGHMEM (Vlastimil Babka)

* tag 'slab-for-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
mm/mempool: fix poisoning order>0 pages with HIGHMEM

+26 -6
+26 -6
mm/mempool.c
··· 68 68 } else if (pool->free == mempool_free_pages) { 69 69 /* Mempools backed by page allocator */ 70 70 int order = (int)(long)pool->pool_data; 71 - void *addr = kmap_local_page((struct page *)element); 72 71 73 - __check_element(pool, addr, 1UL << (PAGE_SHIFT + order)); 74 - kunmap_local(addr); 72 + #ifdef CONFIG_HIGHMEM 73 + for (int i = 0; i < (1 << order); i++) { 74 + struct page *page = (struct page *)element; 75 + void *addr = kmap_local_page(page + i); 76 + 77 + __check_element(pool, addr, PAGE_SIZE); 78 + kunmap_local(addr); 79 + } 80 + #else 81 + void *addr = page_address((struct page *)element); 82 + 83 + __check_element(pool, addr, PAGE_SIZE << order); 84 + #endif 75 85 } 76 86 } 77 87 ··· 107 97 } else if (pool->alloc == mempool_alloc_pages) { 108 98 /* Mempools backed by page allocator */ 109 99 int order = (int)(long)pool->pool_data; 110 - void *addr = kmap_local_page((struct page *)element); 111 100 112 - __poison_element(addr, 1UL << (PAGE_SHIFT + order)); 113 - kunmap_local(addr); 101 + #ifdef CONFIG_HIGHMEM 102 + for (int i = 0; i < (1 << order); i++) { 103 + struct page *page = (struct page *)element; 104 + void *addr = kmap_local_page(page + i); 105 + 106 + __poison_element(addr, PAGE_SIZE); 107 + kunmap_local(addr); 108 + } 109 + #else 110 + void *addr = page_address((struct page *)element); 111 + 112 + __poison_element(addr, PAGE_SIZE << order); 113 + #endif 114 114 } 115 115 } 116 116 #else /* CONFIG_SLUB_DEBUG_ON */