Re: [syzbot] KASAN: stack-out-of-bounds Write in check_move_unevictable_pages

From: Matthew Wilcox
Date: Tue Jun 07 2022 - 22:07:38 EST


On Tue, Jun 07, 2022 at 09:24:21AM -0700, syzbot wrote:
> BUG: KASAN: vmalloc-out-of-bounds in folio_batch_add include/linux/pagevec.h:130 [inline]
> BUG: KASAN: vmalloc-out-of-bounds in check_move_unevictable_pages+0x3f6/0x440 mm/vmscan.c:4857

Oh, I forgot to call folio_batch_init(), so ->nr contains some stack
garbage and we index into hyperspace. I'll fix it up, thanks.