[PATCH v6 16/18] khwasan, mm, arm64: tag non slab memory allocated via pagealloc

From
Andrey Ryabinin <hidden>
Date
2018-09-07 16:06:39
Also in
linux-doc, linux-kbuild, linux-mm, lkml
Reply to
Andrey Konovalov, 2018-08-29

On 08/29/2018 02:35 PM, Andrey Konovalov wrote:
quoted hunk ↗ jump to hunk
 void kasan_poison_slab(struct page *page)
 {
+	unsigned long i;
+
+	if (IS_ENABLED(CONFIG_SLAB))
+		page->s_mem = reset_tag(page->s_mem);
Why reinitialize here, instead of single initialization in alloc_slabmgmt()?

quoted hunk ↗ jump to hunk
+	for (i = 0; i < (1 << compound_order(page)); i++)
+		page_kasan_tag_reset(page + i);
 	kasan_poison_shadow(page_address(page),
 			PAGE_SIZE << compound_order(page),
 			KASAN_KMALLOC_REDZONE);
Thread (55 messages) 55 messages, 7 authors, last reply 2018-09-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help