mirror of https://github.com/torvalds/linux.git
slab fix for 6.18-rc7
-----BEGIN PGP SIGNATURE----- iQFPBAABCAA5FiEEe7vIQRWZI0iWSE3xu+CwddJFiJoFAmkfYFEbFIAAAAAABAAO bWFudTIsMi41KzEuMTEsMiwyAAoJELvgsHXSRYiaLtEIAKDAXWXlwCO3CVDb5USk t1KFTpmQ3UCPDd48eTRbeC6D0B3Jh7+JOa/f96yxQrQOABm2P3xuU30HcqLsWbfV D08MB2u/eyjcghBAqZ95WzdKUcMdzx90qlCnwUE/tDbcFhEc3FutPjqRUQ2iJcyu dk3K6yNl+LiQiw+BVLu+WgQD1fFStuSQ4H3oDHSL2ep0C+vv6jVBEKoiybHFvexQ okrVVBgL7RlPbz+n6t4bsaR64jGa+P9DeiGDGU9gM+kOdP5dYKcmOq0q5dliNOVw 6Bnf9T+zykU6NdQZjwx32eZZoocCg+DT2K+NDvLqeg8PsAGktwQWYDEKnM0yoRMk 7nY= =Lmv8 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
c966813ea1
32
mm/mempool.c
32
mm/mempool.c
|
|
@ -68,10 +68,20 @@ static void check_element(mempool_t *pool, void *element)
|
|||
} else if (pool->free == mempool_free_pages) {
|
||||
/* Mempools backed by page allocator */
|
||||
int order = (int)(long)pool->pool_data;
|
||||
void *addr = kmap_local_page((struct page *)element);
|
||||
|
||||
__check_element(pool, addr, 1UL << (PAGE_SHIFT + order));
|
||||
kunmap_local(addr);
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
for (int i = 0; i < (1 << order); i++) {
|
||||
struct page *page = (struct page *)element;
|
||||
void *addr = kmap_local_page(page + i);
|
||||
|
||||
__check_element(pool, addr, PAGE_SIZE);
|
||||
kunmap_local(addr);
|
||||
}
|
||||
#else
|
||||
void *addr = page_address((struct page *)element);
|
||||
|
||||
__check_element(pool, addr, PAGE_SIZE << order);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -97,10 +107,20 @@ static void poison_element(mempool_t *pool, void *element)
|
|||
} else if (pool->alloc == mempool_alloc_pages) {
|
||||
/* Mempools backed by page allocator */
|
||||
int order = (int)(long)pool->pool_data;
|
||||
void *addr = kmap_local_page((struct page *)element);
|
||||
|
||||
__poison_element(addr, 1UL << (PAGE_SHIFT + order));
|
||||
kunmap_local(addr);
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
for (int i = 0; i < (1 << order); i++) {
|
||||
struct page *page = (struct page *)element;
|
||||
void *addr = kmap_local_page(page + i);
|
||||
|
||||
__poison_element(addr, PAGE_SIZE);
|
||||
kunmap_local(addr);
|
||||
}
|
||||
#else
|
||||
void *addr = page_address((struct page *)element);
|
||||
|
||||
__poison_element(addr, PAGE_SIZE << order);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else /* CONFIG_SLUB_DEBUG_ON */
|
||||
|
|
|
|||
Loading…
Reference in New Issue