Message ID | 20241204075248.384215-1-hao.ge@linux.dev (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/alloc_tag: fix vm_module_tags_populate's KASAN poisoning logic | expand |
diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 4ee6caa6d2da..ad31acb1279a 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -421,7 +421,15 @@ static int vm_module_tags_populate(void) __free_page(next_page[i]); return -ENOMEM; } + + kasan_poison_vmalloc((void *)module_tags.start_addr, + vm_module_tags->nr_pages << PAGE_SHIFT); + vm_module_tags->nr_pages += nr; + + kasan_unpoison_vmalloc((void *)module_tags.start_addr, + vm_module_tags->nr_pages << PAGE_SHIFT, + KASAN_VMALLOC_PROT_NORMAL); } return 0;