BUG: Bad page state (3)

42 views
Skip to first unread message

syzbot

unread,
Jan 1, 2018, 2:03:02 AM1/1/18
to ak...@linux-foundation.org, ar...@arndb.de, dave....@intel.com, gre...@linuxfoundation.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, mi...@kernel.org, ross.z...@linux.intel.com, syzkall...@googlegroups.com, tg...@linutronix.de
Hello,

syzkaller hit the following crash on
30a7acd573899fd8b8ac39236eff6468b195ac7d
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.
C reproducer is attached
syzkaller reproducer is attached. See https://goo.gl/kgGztJ
for information about syzkaller reproducers


IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+b8845c...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

BUG: Bad page state in process syzkaller246299 pfn:1c0c5f
page:000000004c4544aa count:1 mapcount:1 mapping: (null) index:0x0
flags: 0x2fffc0000000004(referenced)
raw: 02fffc0000000004 0000000000000000 0000000000000000 0000000100000000
raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
Modules linked in:
CPU: 1 PID: 3493 Comm: syzkaller246299 Not tainted 4.15.0-rc6+ #245
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:53
bad_page+0x230/0x2b0 mm/page_alloc.c:577
free_pages_check_bad+0x1f0/0x2e0 mm/page_alloc.c:955
free_pages_check mm/page_alloc.c:964 [inline]
free_pages_prepare mm/page_alloc.c:1054 [inline]
free_pcp_prepare mm/page_alloc.c:1079 [inline]
free_unref_page_prepare mm/page_alloc.c:2622 [inline]
free_unref_page+0x594/0x9e0 mm/page_alloc.c:2672
__free_pages+0x107/0x150 mm/page_alloc.c:4297
free_pages+0x51/0x90 mm/page_alloc.c:4309
mon_free_buff drivers/usb/mon/mon_bin.c:1331 [inline]
mon_bin_ioctl+0x653/0xd40 drivers/usb/mon/mon_bin.c:1039
vfs_ioctl fs/ioctl.c:46 [inline]
do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x449229
RSP: 002b:00007f0ec9ebdda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dac3c RCX: 0000000000449229
RDX: 000000000000f0b1 RSI: 0000000000009204 RDI: 0000000000000025
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac38
R13: 6273752f7665642f R14: 00007f0ec9ebe9c0 R15: 0000000000000005
BUG: Bad page map in process syzkaller246299 pte:1c0c5f025 pmd:1c06e8067
page:000000004c4544aa count:1 mapcount:-1 mapping: (null) index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000001fffffffe
raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
page dumped because: bad pte
addr:0000000087d85e42 vm_flags:040400d4 anon_vma: (null)
mapping:000000002c816cf1 index:2
file:usbmon0 fault:mon_bin_vma_fault mmap:mon_bin_mmap readpage:
(null)
CPU: 0 PID: 3492 Comm: syzkaller246299 Tainted: G B
4.15.0-rc6+ #245
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:53
print_bad_pte+0x681/0x8f0 mm/memory.c:771
zap_pte_range mm/memory.c:1336 [inline]
zap_pmd_range mm/memory.c:1438 [inline]
zap_pud_range mm/memory.c:1467 [inline]
zap_p4d_range mm/memory.c:1488 [inline]
unmap_page_range+0x19fd/0x22e0 mm/memory.c:1509
unmap_single_vma+0x15f/0x2d0 mm/memory.c:1554
unmap_vmas+0xf1/0x1b0 mm/memory.c:1584
unmap_region+0x2b9/0x4f0 mm/mmap.c:2511
do_munmap+0x726/0xdf0 mm/mmap.c:2726
mmap_region+0x59e/0x15a0 mm/mmap.c:1646
do_mmap+0x6c0/0xe00 mm/mmap.c:1483
do_mmap_pgoff include/linux/mm.h:2217 [inline]
vm_mmap_pgoff+0x1de/0x280 mm/util.c:333
SYSC_mmap_pgoff mm/mmap.c:1533 [inline]
SyS_mmap_pgoff+0x23b/0x5f0 mm/mmap.c:1491
SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91
entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x449229
RSP: 002b:00007f0ec9eded98 EFLAGS: 00000212 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00000000006dac24 RCX: 0000000000449229
RDX: 0000000000000003 RSI: 0000000000fff000 RDI: 0000000020000000
RBP: 0000000000000000 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000032 R11: 0000000000000212 R12: 00000000006dac20
R13: 6273752f7665642f R14: 00007f0ec9edf9c0 R15: 0000000000000005
BUG: Bad page state in process syzkaller246299 pfn:1c0c5f
page:000000004c4544aa count:0 mapcount:-1 mapping: (null) index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000fffffffe
raw: ffffea0007051720 ffffea00070084e0 0000000000000000 0000000000000000
page dumped because: nonzero mapcount
Modules linked in:
CPU: 0 PID: 3492 Comm: syzkaller246299 Tainted: G B
4.15.0-rc6+ #245
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:53
bad_page+0x230/0x2b0 mm/page_alloc.c:577
free_pages_check_bad+0x1f0/0x2e0 mm/page_alloc.c:955
free_pages_check mm/page_alloc.c:964 [inline]
free_pages_prepare mm/page_alloc.c:1054 [inline]
free_pcp_prepare mm/page_alloc.c:1079 [inline]
free_unref_page_prepare mm/page_alloc.c:2622 [inline]
free_unref_page_list+0x4ba/0x1380 mm/page_alloc.c:2692
release_pages+0xbd1/0x1230 mm/swap.c:820
free_pages_and_swap_cache+0x2ad/0x400 mm/swap_state.c:322
tlb_flush_mmu_free+0xb4/0x160 mm/memory.c:260
tlb_flush_mmu mm/memory.c:269 [inline]
arch_tlb_finish_mmu+0x9d/0x130 mm/memory.c:284
tlb_finish_mmu+0x10f/0x190 mm/memory.c:427
unmap_region+0x35c/0x4f0 mm/mmap.c:2514
do_munmap+0x726/0xdf0 mm/mmap.c:2726
mmap_region+0x59e/0x15a0 mm/mmap.c:1646
do_mmap+0x6c0/0xe00 mm/mmap.c:1483
do_mmap_pgoff include/linux/mm.h:2217 [inline]
vm_mmap_pgoff+0x1de/0x280 mm/util.c:333
SYSC_mmap_pgoff mm/mmap.c:1533 [inline]
SyS_mmap_pgoff+0x23b/0x5f0 mm/mmap.c:1491
SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91
entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x449229
RSP: 002b:00007f0ec9eded98 EFLAGS: 00000212 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00000000006dac24 RCX: 0000000000449229
RDX: 0000000000000003 RSI: 0000000000fff000 RDI: 0000000020000000
RBP: 0000000000000000 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000032 R11: 0000000000000212 R12: 00000000006dac20
R13: 6273752f7665642f R14: 00007f0ec9edf9c0 R15: 0000000000000005
page:000000006359eadf count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: ffffea000702dae0 ffffea0007000a20 ffff8801d9842980 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) <= 0)
------------[ cut here ]------------
kernel BUG at ./include/linux/mm.h:844!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3492 Comm: syzkaller246299 Tainted: G B
4.15.0-rc6+ #245
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:get_page include/linux/mm.h:844 [inline]
RIP: 0010:mon_bin_vma_fault+0x2f4/0x400 drivers/usb/mon/mon_bin.c:1239
RSP: 0018:ffff8801bfcc7510 EFLAGS: 00010203
RAX: 0000000000000000 RBX: 1ffff10037f98ea4 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 1ffff10037f98dee RDI: ffffed0037f98e90
RBP: ffff8801bfcc75e8 R08: 0000000000000000 R09: 1ffff10037f98dc0
R10: dffffc0000000000 R11: ffffffff86937c98 R12: 1ffff10037f98ea8
R13: dffffc0000000000 R14: ffff8801bfcc7840 R15: ffffea0007031b80
FS: 00007f0ec9edf700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000208be000 CR3: 00000001c1328003 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__do_fault+0xeb/0x30f mm/memory.c:3196
do_read_fault mm/memory.c:3606 [inline]
do_fault mm/memory.c:3706 [inline]
handle_pte_fault mm/memory.c:3937 [inline]
__handle_mm_fault+0x1d8f/0x3ce0 mm/memory.c:4061
handle_mm_fault+0x334/0x8d0 mm/memory.c:4098
faultin_page mm/gup.c:502 [inline]
__get_user_pages+0x50c/0x15f0 mm/gup.c:699
populate_vma_page_range+0x20e/0x2f0 mm/gup.c:1216
__mm_populate+0x23a/0x450 mm/gup.c:1266
mm_populate include/linux/mm.h:2226 [inline]
vm_mmap_pgoff+0x241/0x280 mm/util.c:338
SYSC_mmap_pgoff mm/mmap.c:1533 [inline]
SyS_mmap_pgoff+0x462/0x5f0 mm/mmap.c:1491
SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91
entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x449229
RSP: 002b:00007f0ec9eded98 EFLAGS: 00000212 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00000000006dac24 RCX: 0000000000449229
RDX: 0000000001000004 RSI: 0000000000004000 RDI: 0000000020ac6000
RBP: 0000000000000000 R08: 0000000000000028 R09: 0000000000000000
R10: 0000000000008011 R11: 0000000000000212 R12: 00000000006dac20
R13: 6273752f7665642f R14: 00007f0ec9edf9c0 R15: 0000000000000005
Code: 00 44 89 e0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 41 bc 02 00 00 00 eb bb
e8 2b b0 94 fd 48 c7 c6 20 b1 12 86 4c 89 ff e8 bc 98 bd fd <0f> 0b 48 89
95 28 ff ff ff 48 89 85 30 ff ff ff e8 07 b0 94 fd
RIP: get_page include/linux/mm.h:844 [inline] RSP: ffff8801bfcc7510
RIP: mon_bin_vma_fault+0x2f4/0x400 drivers/usb/mon/mon_bin.c:1239 RSP:
ffff8801bfcc7510
---[ end trace eab452fee2528eee ]---


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
If you want to test a patch for this bug, please reply with:
#syz test: git://repo/address.git branch
and provide the patch inline or as an attachment.
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
config.txt
raw.log
repro.txt
repro.c

Eric Biggers

unread,
Feb 1, 2018, 6:47:17 PM2/1/18
to syzbot, ak...@linux-foundation.org, ar...@arndb.de, dave....@intel.com, gre...@linuxfoundation.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, mi...@kernel.org, ross.z...@linux.intel.com, syzkall...@googlegroups.com, tg...@linutronix.de, zai...@redhat.com
Crash is no longer occurring, seems to have been fixed by commit 46eb14a6e1585:

#syz fix: USB: fix usbmon BUG trigger

- Eric
Reply all
Reply to author
Forward
0 new messages