Re: kernel BUG at mm/vmscan.c:LINE! (2)

From: David Hildenbrand
Date: Mon Oct 28 2019 - 12:18:41 EST

On 02.08.19 22:06, Minchan Kim wrote:
On Fri, Aug 02, 2019 at 10:58:05AM -0700, syzbot wrote:

syzbot found the following crash on:

HEAD commit: 0d8b3265 Add linux-next specific files for 20190729
git tree: linux-next
console output:
kernel config:
dashboard link:
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:
C reproducer:

The bug was bisected to:

commit 06a833a1167e9cbb43a9a4317ec24585c6ec85cb
Author: Minchan Kim <minchan@xxxxxxxxxx>
Date: Sat Jul 27 05:12:38 2019 +0000

mm: introduce MADV_PAGEOUT

bisection log:
final crash:
console output:

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+8e6326965378936537c3@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 06a833a1167e ("mm: introduce MADV_PAGEOUT")

raw: 01fffc0000090025 dead000000000100 dead000000000122 ffff88809c49f741
raw: 0000000000020000 0000000000000000 00000002ffffffff ffff88821b6eaac0
page dumped because: VM_BUG_ON_PAGE(PageActive(page))
------------[ cut here ]------------
kernel BUG at mm/vmscan.c:1156!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 9846 Comm: syz-executor110 Not tainted 5.3.0-rc2-next-20190729
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:shrink_page_list+0x2872/0x5430 mm/vmscan.c:1156

My old version had PG_active flag clear but it seems to lose it with revising
patchsets. Thanks, Sizbot!

From 66d64988619ef7e86b0002b2fc20fdf5b84ad49c Mon Sep 17 00:00:00 2001
From: Minchan Kim <minchan@xxxxxxxxxx>
Date: Sat, 3 Aug 2019 04:54:02 +0900
Subject: [PATCH] mm: Clear PG_active on MADV_PAGEOUT

shrink_page_list expects every pages as argument should be no active
LRU pages so we need to clear PG_active.

Reported-by: syzbot+8e6326965378936537c3@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 06a833a1167e ("mm: introduce MADV_PAGEOUT")

I think this should be

Fixed: 1a4e58cce84e ("mm: introduce MADV_PAGEOUT")

$ git show 1a4e58cce84e
commit 1a4e58cce84ee88129d5d49c064bd2852b481357
Author: Minchan Kim <minchan@xxxxxxxxxx>
Date: Wed Sep 25 16:49:15 2019 -0700

mm: introduce MADV_PAGEOUT

$ git tag --contains 1a4e58cce84ee88129d5d49c064bd2852b481357



David / dhildenb