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

24 views
Skip to first unread message

syzbot

unread,
Aug 2, 2019, 1:58:06 PM8/2/19
to ak...@linux-foundation.org, ch...@chrisdown.name, ch...@zankel.net, dan...@google.com, dave....@intel.com, han...@cmpxchg.org, hda...@sina.com, james.b...@hansenpartnership.com, kirill....@linux.intel.com, ktk...@virtuozzo.com, laoar...@gmail.com, linux-...@vger.kernel.org, linu...@kvack.org, mgo...@techsingularity.net, mho...@kernel.org, mho...@suse.com, min...@kernel.org, olek...@redhat.com, ra...@linux-mips.org, r...@twiddle.net, s...@canb.auug.org.au, shak...@google.com, sonn...@google.com, sur...@google.com, syzkall...@googlegroups.com, timm...@google.com, yang...@linux.alibaba.com
Hello,

syzbot found the following crash on:

HEAD commit: 0d8b3265 Add linux-next specific files for 20190729
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1663c7d0600000
kernel config: https://syzkaller.appspot.com/x/.config?x=ae96f3b8a7e885f7
dashboard link: https://syzkaller.appspot.com/bug?extid=8e6326965378936537c3
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=133c437c600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15645854600000

The bug was bisected to:

commit 06a833a1167e9cbb43a9a4317ec24585c6ec85cb
Author: Minchan Kim <min...@kernel.org>
Date: Sat Jul 27 05:12:38 2019 +0000

mm: introduce MADV_PAGEOUT

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1545f764600000
final crash: https://syzkaller.appspot.com/x/report.txt?x=1745f764600000
console output: https://syzkaller.appspot.com/x/log.txt?x=1345f764600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+8e6326...@syzkaller.appspotmail.com
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))
page->mem_cgroup:ffff88821b6eaac0
------------[ 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
#54
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
Code: d9 ea ff ff e8 df 3c dd ff 4c 8d 6b ff e9 1c db ff ff e8 d1 3c dd ff
48 8b bd 10 ff ff ff 48 c7 c6 80 85 93 87 e8 fe 10 07 00 <0f> 0b e8 b7 3c
dd ff be 08 00 00 00 4c 89 ef e8 0a f2 17 00 4c 89
RSP: 0018:ffff888092427598 EFLAGS: 00010293
RAX: ffff88809a6a43c0 RBX: 0000000000000020 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff819bfec7 RDI: ffffed1012484e97
RBP: ffff888092427730 R08: 0000000000000021 R09: ffffed1015d260d1
R10: ffffed1015d260d0 R11: ffff8880ae930687 R12: dffffc0000000000
R13: ffffea0002198000 R14: 0000000000000000 R15: ffffea0002198008
FS: 000055555617d880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 00000000a818a000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
reclaim_pages+0x3b8/0x8f0 mm/vmscan.c:2202
madvise_cold_or_pageout_pte_range+0x18c4/0x2e20 mm/madvise.c:391
walk_pmd_range mm/pagewalk.c:51 [inline]
walk_pud_range mm/pagewalk.c:109 [inline]
walk_p4d_range mm/pagewalk.c:135 [inline]
walk_pgd_range mm/pagewalk.c:161 [inline]
__walk_page_range+0xd2a/0x1680 mm/pagewalk.c:254
walk_page_range+0x1a6/0x3e0 mm/pagewalk.c:335
madvise_pageout_page_range.isra.0+0xdd/0x120 mm/madvise.c:532
madvise_pageout+0x227/0x3a0 mm/madvise.c:568
madvise_vma mm/madvise.c:965 [inline]
__do_sys_madvise mm/madvise.c:1145 [inline]
__se_sys_madvise mm/madvise.c:1073 [inline]
__x64_sys_madvise+0x719/0x1500 mm/madvise.c:1073
do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440149
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff
ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffdb1a77db8 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440149
RDX: 0000000000000015 RSI: 0000000000600003 RDI: 0000000020000000
RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004019d0
R13: 0000000000401a60 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace f888ef64246a2afc ]---
RIP: 0010:shrink_page_list+0x2872/0x5430 mm/vmscan.c:1156
Code: d9 ea ff ff e8 df 3c dd ff 4c 8d 6b ff e9 1c db ff ff e8 d1 3c dd ff
48 8b bd 10 ff ff ff 48 c7 c6 80 85 93 87 e8 fe 10 07 00 <0f> 0b e8 b7 3c
dd ff be 08 00 00 00 4c 89 ef e8 0a f2 17 00 4c 89
RSP: 0018:ffff888092427598 EFLAGS: 00010293
RAX: ffff88809a6a43c0 RBX: 0000000000000020 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff819bfec7 RDI: ffffed1012484e97
RBP: ffff888092427730 R08: 0000000000000021 R09: ffffed1015d260d1
R10: ffffed1015d260d0 R11: ffff8880ae930687 R12: dffffc0000000000
R13: ffffea0002198000 R14: 0000000000000000 R15: ffffea0002198008
FS: 000055555617d880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 00000000a818a000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

Minchan Kim

unread,
Aug 2, 2019, 4:06:54 PM8/2/19
to syzbot, ak...@linux-foundation.org, ch...@chrisdown.name, ch...@zankel.net, dan...@google.com, dave....@intel.com, han...@cmpxchg.org, hda...@sina.com, james.b...@hansenpartnership.com, kirill....@linux.intel.com, ktk...@virtuozzo.com, laoar...@gmail.com, linux-...@vger.kernel.org, linu...@kvack.org, mgo...@techsingularity.net, mho...@kernel.org, mho...@suse.com, olek...@redhat.com, ra...@linux-mips.org, r...@twiddle.net, s...@canb.auug.org.au, shak...@google.com, sonn...@google.com, sur...@google.com, syzkall...@googlegroups.com, timm...@google.com, yang...@linux.alibaba.com
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 <min...@kernel.org>
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+8e6326...@syzkaller.appspotmail.com
Fixes: 06a833a1167e ("mm: introduce MADV_PAGEOUT")
Signed-off-by: Minchan Kim <min...@kernel.org>
---
mm/vmscan.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 47aa2158cfac2..e2a8d3f5bbe48 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2181,6 +2181,7 @@ unsigned long reclaim_pages(struct list_head *page_list)
}

if (nid == page_to_nid(page)) {
+ ClearPageActive(page);
list_move(&page->lru, &node_page_list);
continue;
}
--
2.22.0.770.g0f2c4a37fd-goog

Michal Hocko

unread,
Aug 6, 2019, 4:29:12 AM8/6/19
to Minchan Kim, syzbot, ak...@linux-foundation.org, ch...@chrisdown.name, ch...@zankel.net, dan...@google.com, dave....@intel.com, han...@cmpxchg.org, hda...@sina.com, james.b...@hansenpartnership.com, kirill....@linux.intel.com, ktk...@virtuozzo.com, laoar...@gmail.com, linux-...@vger.kernel.org, linu...@kvack.org, mgo...@techsingularity.net, olek...@redhat.com, ra...@linux-mips.org, r...@twiddle.net, s...@canb.auug.org.au, shak...@google.com, sonn...@google.com, sur...@google.com, syzkall...@googlegroups.com, timm...@google.com, yang...@linux.alibaba.com
Ups, missed that during review.

>
> Reported-by: syzbot+8e6326...@syzkaller.appspotmail.com
> Fixes: 06a833a1167e ("mm: introduce MADV_PAGEOUT")

This is not a valid sha1 because it likely comes from linux-next. I
guess Andrew will squash it into mm-introduce-madv_pageout.patch

Just for the record
Acked-by: Michal Hocko <mho...@suse.com>

And thanks for syzkaller to exercise the new interface so quickly!

> Signed-off-by: Minchan Kim <min...@kernel.org>
> ---
> mm/vmscan.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 47aa2158cfac2..e2a8d3f5bbe48 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2181,6 +2181,7 @@ unsigned long reclaim_pages(struct list_head *page_list)
> }
>
> if (nid == page_to_nid(page)) {
> + ClearPageActive(page);
> list_move(&page->lru, &node_page_list);
> continue;
> }
> --
> 2.22.0.770.g0f2c4a37fd-goog

--
Michal Hocko
SUSE Labs

Dmitry Vyukov

unread,
Aug 8, 2019, 12:34:30 PM8/8/19
to Michal Hocko, Minchan Kim, syzbot, Andrew Morton, Chris Down, ch...@zankel.net, dan...@google.com, Dave Hansen, Johannes Weiner, Hillf Danton, James Bottomley, Kirill A. Shutemov, Kirill Tkhai, laoar...@gmail.com, LKML, Linux-MM, Mel Gorman, olek...@redhat.com, Ralf Baechle, r...@twiddle.net, Stephen Rothwell, Shakeel Butt, Sonny Rao, sur...@google.com, syzkaller-bugs, Tim Murray, yang...@linux.alibaba.com
syzkaller don't have any new descriptions for MADV_PAGEOUT. It's just
the power of rand. If there is something more complex than just a
single flag, then it may benefit from explicit interface descriptions.


> > Signed-off-by: Minchan Kim <min...@kernel.org>
> > ---
> > mm/vmscan.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index 47aa2158cfac2..e2a8d3f5bbe48 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -2181,6 +2181,7 @@ unsigned long reclaim_pages(struct list_head *page_list)
> > }
> >
> > if (nid == page_to_nid(page)) {
> > + ClearPageActive(page);
> > list_move(&page->lru, &node_page_list);
> > continue;
> > }
> > --
> > 2.22.0.770.g0f2c4a37fd-goog
>
> --
> Michal Hocko
> SUSE Labs
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/20190806082907.GI11812%40dhcp22.suse.cz.

David Hildenbrand

unread,
Oct 28, 2019, 12:18:40 PM10/28/19
to Minchan Kim, syzbot, ak...@linux-foundation.org, ch...@chrisdown.name, ch...@zankel.net, dan...@google.com, dave....@intel.com, han...@cmpxchg.org, hda...@sina.com, james.b...@hansenpartnership.com, kirill....@linux.intel.com, ktk...@virtuozzo.com, laoar...@gmail.com, linux-...@vger.kernel.org, linu...@kvack.org, mgo...@techsingularity.net, mho...@kernel.org, mho...@suse.com, olek...@redhat.com, ra...@linux-mips.org, r...@twiddle.net, s...@canb.auug.org.au, shak...@google.com, sonn...@google.com, sur...@google.com, syzkall...@googlegroups.com, timm...@google.com, yang...@linux.alibaba.com
I think this should be

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


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

mm: introduce MADV_PAGEOUT
[...]

$ git tag --contains 1a4e58cce84ee88129d5d49c064bd2852b481357
[...]
v5.4-rc5


--

Thanks,

David / dhildenb

Eric Biggers

unread,
Jun 27, 2020, 7:44:03 PM6/27/20
to syzbot, syzkall...@googlegroups.com
This got folded into the original patch "mm: introduce MADV_PAGEOUT", so telling
syzbot

#syz invalid
Reply all
Reply to author
Forward
0 new messages