kernel BUG at include/linux/mm.h:LINE! (6)

63 views
Skip to first unread message

syzbot

unread,
Apr 19, 2020, 11:28:15 AM4/19/20
to ak...@linux-foundation.org, linux-...@vger.kernel.org, linu...@kvack.org, syzkall...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 8632e9b5 Merge tag 'hyperv-fixes-signed' of git://git.kern..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11ac6be0100000
kernel config: https://syzkaller.appspot.com/x/.config?x=5d351a1019ed81a2
dashboard link: https://syzkaller.appspot.com/bug?extid=a923008018a2d298247b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+a92300...@syzkaller.appspotmail.com

raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
------------[ cut here ]------------
kernel BUG at include/linux/mm.h:699!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 14511 Comm: syz-executor.4 Not tainted 5.7.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:put_page_testzero include/linux/mm.h:699 [inline]
RIP: 0010:put_page_testzero include/linux/mm.h:697 [inline]
RIP: 0010:release_pages+0x799/0x19b0 mm/swap.c:823
Code: c7 f9 ff ff e8 38 9d dd ff 48 89 ef e8 20 ac ff ff e9 96 fe ff ff e8 26 9d dd ff 48 c7 c6 c0 44 33 88 48 89 ef e8 87 86 09 00 <0f> 0b e8 10 9d dd ff 49 8d 6c 24 ff e9 c5 f9 ff ff 4c 8d 6d 08 31
RSP: 0018:ffffc90007fb7640 EFLAGS: 00010293
RAX: ffff8880a19f4280 RBX: 0000000000000000 RCX: ffffffff819f2d28
RDX: 0000000000000000 RSI: ffffffff819596e9 RDI: ffffea0000000038
RBP: ffffea0000000000 R08: ffff8880a19f4280 R09: ffffed1015cc66a9
R10: ffff8880ae633547 R11: ffffed1015cc66a8 R12: ffffea0000000034
R13: 0000000000000000 R14: dffffc0000000000 R15: 00000000000000c6
FS: 00007fc0946fc700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2142ba1db8 CR3: 000000008859f000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:242 [inline]
tlb_flush_mmu+0x8d/0x610 mm/mmu_gather.c:249
zap_pte_range mm/memory.c:1158 [inline]
zap_pmd_range mm/memory.c:1196 [inline]
zap_pud_range mm/memory.c:1225 [inline]
zap_p4d_range mm/memory.c:1246 [inline]
unmap_page_range+0x198d/0x25d0 mm/memory.c:1267
unmap_single_vma+0x196/0x300 mm/memory.c:1312
unmap_vmas+0x16f/0x2f0 mm/memory.c:1344
exit_mmap+0x2aa/0x510 mm/mmap.c:3150
__mmput kernel/fork.c:1085 [inline]
mmput+0x168/0x4b0 kernel/fork.c:1106
exit_mm kernel/exit.c:479 [inline]
do_exit+0xa51/0x2dd0 kernel/exit.c:782
do_group_exit+0x125/0x340 kernel/exit.c:893
get_signal+0x47b/0x24e0 kernel/signal.c:2739
do_signal+0x81/0x2240 arch/x86/kernel/signal.c:784
exit_to_usermode_loop+0x26c/0x360 arch/x86/entry/common.c:161
prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45c6f7
Code: 48 83 c4 08 48 89 d8 5b 5d c3 66 0f 1f 84 00 00 00 00 00 48 89 e8 48 f7 d8 48 39 c3 0f 92 c0 eb 92 66 90 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 0d b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc0946fa068 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 000000000045c6f7
RDX: 00007fc0946fa510 RSI: 000000004020ae46 RDI: 0000000000000004
RBP: 0000000020000000 R08: 00007fc0946fa070 R09: 000000000076bfa0
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000fec00000
R13: 0000000000000004 R14: 00000000004cdf60 R15: 000000000076bfac
Modules linked in:
---[ end trace 56c4701a85e32af3 ]---
RIP: 0010:put_page_testzero include/linux/mm.h:699 [inline]
RIP: 0010:put_page_testzero include/linux/mm.h:697 [inline]
RIP: 0010:release_pages+0x799/0x19b0 mm/swap.c:823
Code: c7 f9 ff ff e8 38 9d dd ff 48 89 ef e8 20 ac ff ff e9 96 fe ff ff e8 26 9d dd ff 48 c7 c6 c0 44 33 88 48 89 ef e8 87 86 09 00 <0f> 0b e8 10 9d dd ff 49 8d 6c 24 ff e9 c5 f9 ff ff 4c 8d 6d 08 31
RSP: 0018:ffffc90007fb7640 EFLAGS: 00010293
RAX: ffff8880a19f4280 RBX: 0000000000000000 RCX: ffffffff819f2d28
RDX: 0000000000000000 RSI: ffffffff819596e9 RDI: ffffea0000000038
RBP: ffffea0000000000 R08: ffff8880a19f4280 R09: ffffed1015cc66a9
R10: ffff8880ae633547 R11: ffffed1015cc66a8 R12: ffffea0000000034
R13: 0000000000000000 R14: dffffc0000000000 R15: 00000000000000c6
FS: 00007fc0946fc700(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9347e2b000 CR3: 000000004d8bb000 CR4: 00000000001426e0
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.

Hillf Danton

unread,
Apr 20, 2020, 12:16:08 AM4/20/20
to syzbot, ak...@linux-foundation.org, linux-...@vger.kernel.org, Minchan Kim, Johannes Weiner, linu...@kvack.org, syzkall...@googlegroups.com

Sun, 19 Apr 2020 08:28:14 -0700
Flush TLB every chance before we get every thing done.

--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1080,8 +1080,8 @@ again:
page_remove_rmap(page, false);
if (unlikely(page_mapcount(page) < 0))
print_bad_pte(vma, addr, ptent, page);
+ force_flush = 1;
if (unlikely(__tlb_remove_page(tlb, page))) {
- force_flush = 1;
addr += PAGE_SIZE;
break;
}
@@ -1146,10 +1146,9 @@ again:
tlb_flush_mmu(tlb);
}

- if (addr != end) {
- cond_resched();
+ cond_resched();
+ if (addr != end)
goto again;
- }

return addr;
}

Michal Hocko

unread,
Apr 20, 2020, 11:07:01 AM4/20/20
to Hillf Danton, syzbot, ak...@linux-foundation.org, linux-...@vger.kernel.org, Minchan Kim, Johannes Weiner, linu...@kvack.org, syzkall...@googlegroups.com
On Mon 20-04-20 12:15:33, Hillf Danton wrote:
>
> Sun, 19 Apr 2020 08:28:14 -0700
> > syzbot found the following crash on:
> >
> > HEAD commit: 8632e9b5 Merge tag 'hyperv-fixes-signed' of git://git.kern..
> > git tree: upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=11ac6be0100000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=5d351a1019ed81a2
> > dashboard link: https://syzkaller.appspot.com/bug?extid=a923008018a2d298247b
> > compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> >
> > Unfortunately, I don't have any reproducer for this crash yet.
> >
> > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > Reported-by: syzbot+a92300...@syzkaller.appspotmail.com
> >
> > raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
> > page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)

This looks like a page reference count underflow. If there is a
reproducer then page_owner might help to tell who was the last owner.
[...]

> Flush TLB every chance before we get every thing done.
>
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1080,8 +1080,8 @@ again:
> page_remove_rmap(page, false);
> if (unlikely(page_mapcount(page) < 0))
> print_bad_pte(vma, addr, ptent, page);
> + force_flush = 1;
> if (unlikely(__tlb_remove_page(tlb, page))) {
> - force_flush = 1;
> addr += PAGE_SIZE;
> break;
> }
> @@ -1146,10 +1146,9 @@ again:
> tlb_flush_mmu(tlb);
> }
>
> - if (addr != end) {
> - cond_resched();
> + cond_resched();
> + if (addr != end)
> goto again;
> - }
>
> return addr;
> }

This patch doesn't make any sense to me wrt to the above report. What
are you trying to achieve?

--
Michal Hocko
SUSE Labs

syzbot

unread,
Sep 25, 2020, 11:21:17 PM9/25/20
to ak...@linux-foundation.org, b...@alien8.de, dave....@linux.intel.com, han...@cmpxchg.org, hda...@sina.com, h...@zytor.com, linux-...@vger.kernel.org, linu...@kvack.org, lu...@kernel.org, mho...@kernel.org, min...@kernel.org, mi...@redhat.com, pet...@infradead.org, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
syzbot has found a reproducer for the following issue on:

HEAD commit: 171d4ff7 Merge tag 'mmc-v5.9-rc4-2' of git://git.kernel.or..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1197c517900000
kernel config: https://syzkaller.appspot.com/x/.config?x=240e2ebab67245c7
dashboard link: https://syzkaller.appspot.com/bug?extid=a923008018a2d298247b
compiler: gcc (GCC) 10.1.0-syz 20200507
userspace arch: i386
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10c679ad900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1125efab900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a92300...@syzkaller.appspotmail.com

raw: 0000000000000000 ffff888096b02ae0 00000001ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page->pmd_huge_pte)
------------[ cut here ]------------
kernel BUG at include/linux/mm.h:2260!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 6951 Comm: syz-executor101 Not tainted 5.9.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:pgtable_pmd_page_dtor include/linux/mm.h:2260 [inline]
RIP: 0010:pgtable_pmd_page_dtor include/linux/mm.h:2257 [inline]
RIP: 0010:___pmd_free_tlb+0x108/0x140 arch/x86/mm/pgtable.c:72
Code: ee e8 5c 8e fe ff 66 90 5b 5d 41 5c 41 5d c3 e8 de 95 40 00 0f 0b e8 d7 95 40 00 48 c7 c6 40 20 89 88 48 89 ef e8 a8 90 6f 00 <0f> 0b e8 c1 95 40 00 0f 0b 48 c7 c7 68 6c fc 89 e8 23 69 81 00 e9
RSP: 0018:ffffc900061678c0 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 000000000008fef6 RCX: ffffffff81a54935
RDX: ffff88808e70a1c0 RSI: ffffffff81a54984 RDI: ffffea00023fbdb8
RBP: ffffea00023fbd80 R08: 0000000000000037 R09: ffff8880ae5318e7
R10: ffffffffffffffff R11: 0000000000000000 R12: ffffc90006167a20
R13: ffff88808fef6000 R14: 0000000021000fff R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000080fd718 CR3: 000000008e534000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__pmd_free_tlb arch/x86/include/asm/pgalloc.h:95 [inline]
free_pmd_range mm/memory.c:255 [inline]
free_pud_range mm/memory.c:273 [inline]
free_p4d_range mm/memory.c:307 [inline]
free_pgd_range+0xa3f/0xf90 mm/memory.c:387
free_pgtables+0x230/0x2f0 mm/memory.c:419
exit_mmap+0x2c0/0x530 mm/mmap.c:3184
__mmput+0x122/0x470 kernel/fork.c:1076
mmput+0x53/0x60 kernel/fork.c:1097
exit_mm kernel/exit.c:483 [inline]
do_exit+0xa8b/0x29f0 kernel/exit.c:793
do_group_exit+0x125/0x310 kernel/exit.c:903
get_signal+0x428/0x1f00 kernel/signal.c:2757
arch_do_signal+0x82/0x2520 arch/x86/kernel/signal.c:811
exit_to_user_mode_loop kernel/entry/common.c:161 [inline]
exit_to_user_mode_prepare+0x1ae/0x200 kernel/entry/common.c:192
syscall_exit_to_user_mode+0x7e/0x2e0 kernel/entry/common.c:267
__do_fast_syscall_32+0x6c/0x90 arch/x86/entry/common.c:138
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7f80549
Code: Bad RIP value.
RSP: 002b:00000000f7f7b1ec EFLAGS: 00000296 ORIG_RAX: 00000000000000f0
RAX: fffffffffffffe00 RBX: 00000000080fafe8 RCX: 0000000000000080
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace f578be228b447c1d ]---
RIP: 0010:pgtable_pmd_page_dtor include/linux/mm.h:2260 [inline]
RIP: 0010:pgtable_pmd_page_dtor include/linux/mm.h:2257 [inline]
RIP: 0010:___pmd_free_tlb+0x108/0x140 arch/x86/mm/pgtable.c:72
Code: ee e8 5c 8e fe ff 66 90 5b 5d 41 5c 41 5d c3 e8 de 95 40 00 0f 0b e8 d7 95 40 00 48 c7 c6 40 20 89 88 48 89 ef e8 a8 90 6f 00 <0f> 0b e8 c1 95 40 00 0f 0b 48 c7 c7 68 6c fc 89 e8 23 69 81 00 e9
RSP: 0018:ffffc900061678c0 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 000000000008fef6 RCX: ffffffff81a54935
RDX: ffff88808e70a1c0 RSI: ffffffff81a54984 RDI: ffffea00023fbdb8
RBP: ffffea00023fbd80 R08: 0000000000000037 R09: ffff8880ae5318e7
R10: ffffffffffffffff R11: 0000000000000000 R12: ffffc90006167a20
R13: ffff88808fef6000 R14: 0000000021000fff R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f7f5a22c CR3: 0000000088483000 CR4: 00000000001506e0

syzbot

unread,
Jun 22, 2023, 10:14:41 AM6/22/23
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages