BUG: spinlock bad magic (2)

13 views
Skip to first unread message

syzbot

unread,
Apr 11, 2019, 8:00:56 PM4/11/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 7be19854 ANDROID: sched: EAS: check energy_aware() before ..
git tree: android-4.9
console output: https://syzkaller.appspot.com/x/log.txt?x=1348f725800000
kernel config: https://syzkaller.appspot.com/x/.config?x=17a1b85c764db343
dashboard link: https://syzkaller.appspot.com/bug?extid=d0746f81dc928e6c4904
compiler: gcc (GCC) 7.1.1 20170620
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=151daef9800000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=148c5725800000

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

kasan: CONFIG_KASAN_INLINE enabled
BUG: spinlock bad magic on CPU#1, syzkaller118423/4066
lock: 0xffff8801b24d8018, .magic: dead4eac, .owner: <none>/-1, .owner_cpu:
-1
CPU: 1 PID: 4066 Comm: syzkaller118423 Not tainted 4.9.78-g7be1985 #24
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
ffff8801db307898 ffffffff81d94409 ffff8801b24d8018 ffff8801d3144800
0000000000000001 0000000000000001 0000000000000000 ffff8801db3078d8
ffffffff812488ed ffffffff81223c2e 0000000000000000 0000000000000000
Call Trace:
<IRQ>
[<ffffffff81d94409>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffffff81d94409>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
[<ffffffff812488ed>] spin_dump+0x14d/0x280
kernel/locking/spinlock_debug.c:67
[<ffffffff81248c24>] spin_bug kernel/locking/spinlock_debug.c:75 [inline]
[<ffffffff81248c24>] debug_spin_lock_before
kernel/locking/spinlock_debug.c:83 [inline]
[<ffffffff81248c24>] do_raw_spin_lock+0x174/0x1e0
kernel/locking/spinlock_debug.c:112
[<ffffffff838b2a96>] __raw_spin_lock_irqsave
include/linux/spinlock_api_smp.h:119 [inline]
[<ffffffff838b2a96>] _raw_spin_lock_irqsave+0x56/0x70
kernel/locking/spinlock.c:159
[<ffffffff81223c2e>] __wake_up+0x1e/0x50 kernel/sched/wait.c:94
[<ffffffff8266b56c>] sg_rq_end_io+0x5dc/0xbc0 drivers/scsi/sg.c:1375
[<ffffffff81d23b64>] __blk_mq_end_request+0x54/0xc0 block/blk-mq.c:331
[<ffffffff825d0ae5>] scsi_end_request+0x135/0x5c0
drivers/scsi/scsi_lib.c:627
[<ffffffff825da71e>] scsi_io_completion+0x15de/0x1730
drivers/scsi/scsi_lib.c:829
[<ffffffff825bd148>] scsi_finish_command+0x3b8/0x530
drivers/scsi/scsi.c:607
[<ffffffff825d7df0>] scsi_softirq_done+0x250/0x350
drivers/scsi/scsi_lib.c:1567
[<ffffffff81d25785>] blk_mq_ipi_complete_request block/blk-mq.c:376
[inline]
[<ffffffff81d25785>] __blk_mq_complete_request+0x205/0x4b0
block/blk-mq.c:388
[<ffffffff81d25a95>] blk_mq_complete_request+0x65/0x80 block/blk-mq.c:407
[<ffffffff825d3f3e>] scsi_mq_done+0xce/0x320 drivers/scsi/scsi_lib.c:1877
[<ffffffff825fe7ef>] virtscsi_complete_cmd+0x5cf/0x7f0
drivers/scsi/virtio_scsi.c:211
[<ffffffff825fc4a9>] virtscsi_vq_done+0xc9/0x170
drivers/scsi/virtio_scsi.c:229
[<ffffffff825fc5f7>] virtscsi_req_done+0xa7/0xd0
drivers/scsi/virtio_scsi.c:244
[<ffffffff81fe0e29>] vring_interrupt+0x109/0x150
drivers/virtio/virtio_ring.c:909
[<ffffffff8126dfbf>] __handle_irq_event_percpu+0xef/0x800
kernel/irq/handle.c:145
[<ffffffff8126e744>] handle_irq_event_percpu+0x74/0x150
kernel/irq/handle.c:185
[<ffffffff8126e8c7>] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:202
[<ffffffff81278f3a>] handle_edge_irq+0x1fa/0x8e0 kernel/irq/chip.c:665
[<ffffffff8105a5de>] generic_handle_irq_desc include/linux/irqdesc.h:150
[inline]
[<ffffffff8105a5de>] handle_irq+0x24e/0x3b0 arch/x86/kernel/irq_64.c:76
[<ffffffff838b5669>] do_IRQ+0x89/0x1b0 arch/x86/kernel/irq.c:239
[<ffffffff838b3720>] common_interrupt+0xa0/0xa0
arch/x86/entry/entry_64.S:565
<EOI>
[<ffffffff8144a703>] free_pages_prepare mm/page_alloc.c:1067 [inline]
[<ffffffff8144a703>] __free_pages_ok+0x1f3/0x16c0 mm/page_alloc.c:1263
[<ffffffff8144bc2e>] free_compound_page+0x5e/0x70 mm/page_alloc.c:594
[<ffffffff81554239>] free_transhuge_page+0x99/0xc0 mm/huge_memory.c:2228
[<ffffffff81464767>] __put_compound_page+0x87/0xb0 mm/swap.c:94
[<ffffffff81465414>] release_pages+0x2e4/0x930 mm/swap.c:763
[<ffffffff8150a2d3>] free_pages_and_swap_cache+0x113/0x160
mm/swap_state.c:273
[<ffffffff814c1e14>] tlb_flush_mmu_free+0xb4/0x160 mm/memory.c:259
[<ffffffff814ca259>] zap_pte_range mm/memory.c:1216 [inline]
[<ffffffff814ca259>] zap_pmd_range mm/memory.c:1258 [inline]
[<ffffffff814ca259>] zap_pud_range mm/memory.c:1279 [inline]
[<ffffffff814ca259>] unmap_page_range+0xfe9/0x1830 mm/memory.c:1300
[<ffffffff814cabab>] unmap_single_vma+0x10b/0x270 mm/memory.c:1345
[<ffffffff814cb511>] unmap_vmas+0xf1/0x1b0 mm/memory.c:1375
[<ffffffff814dc3c5>] unmap_region+0x1e5/0x3a0 mm/mmap.c:2503
[<ffffffff814e05e1>] do_munmap+0x721/0xeb0 mm/mmap.c:2702
[<ffffffff814e68fd>] mmap_region+0x14d/0xfd0 mm/mmap.c:1635
[<ffffffff814e7cfb>] do_mmap+0x57b/0xbe0 mm/mmap.c:1473
[<ffffffff814984bb>] do_mmap_pgoff include/linux/mm.h:2019 [inline]
[<ffffffff814984bb>] vm_mmap_pgoff+0x16b/0x1b0 mm/util.c:305
[<ffffffff814e1da0>] SYSC_mmap_pgoff mm/mmap.c:1523 [inline]
[<ffffffff814e1da0>] SyS_mmap_pgoff+0xd0/0x560 mm/mmap.c:1481
[<ffffffff8105f306>] SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline]
[<ffffffff8105f306>] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86
[<ffffffff838b2c6e>] entry_SYSCALL_64_fastpath+0x29/0xe8
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 4063 Comm: syzkaller118423 Not tainted 4.9.78-g7be1985 #24
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8801d3140000 task.stack: ffff8801d3780000
RIP: 0010:[<ffffffff8144ede1>] [<ffffffff8144ede1>] __read_once_size
include/linux/compiler.h:243 [inline]
RIP: 0010:[<ffffffff8144ede1>] [<ffffffff8144ede1>] atomic_read
arch/x86/include/asm/atomic.h:26 [inline]
RIP: 0010:[<ffffffff8144ede1>] [<ffffffff8144ede1>] page_ref_count
include/linux/page_ref.h:66 [inline]
RIP: 0010:[<ffffffff8144ede1>] [<ffffffff8144ede1>] put_page_testzero
include/linux/mm.h:450 [inline]
RIP: 0010:[<ffffffff8144ede1>] [<ffffffff8144ede1>] __free_pages+0x21/0x80
mm/page_alloc.c:3903
RSP: 0018:ffff8801d37879b0 EFLAGS: 00010a07
RAX: dffffc0000000000 RBX: dead4ead00000000 RCX: ffffffff8266775b
RDX: 1bd5a9d5a0000003 RSI: 0000000000000002 RDI: dead4ead0000001c
RBP: ffff8801d37879c0 R08: 0000000048000000 R09: 0000000000001e30
R10: 0000000000002100 R11: ffff8801d3140000 R12: 0000000000000004
R13: 0000000000000020 R14: ffff8801b2558000 R15: dffffc0000000000
FS: 0000000001175880(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020a13000 CR3: 00000001d9852000 CR4: 0000000000160670
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
0000000000000001 ffff8801b2558158 ffff8801d3787a20 ffffffff82667781
ffff8801b2558170 ffffed00364ab02b ffffed00364ab02e ffff8801b2558168
dead4ead00000000 ffff8801b2558140 0000000000000000 0000000000000000
Call Trace:
[<ffffffff82667781>] sg_remove_scat.isra.19+0x1c1/0x2d0
drivers/scsi/sg.c:1944
[<ffffffff82667b45>] sg_finish_rem_req+0x2b5/0x340 drivers/scsi/sg.c:1825
[<ffffffff82667d5d>] sg_new_read.isra.20+0x18d/0x3e0 drivers/scsi/sg.c:566
[<ffffffff82669877>] sg_read+0x8b7/0x1440 drivers/scsi/sg.c:455
[<ffffffff8156c6a1>] do_loop_readv_writev.part.17+0x141/0x1e0
fs/read_write.c:714
[<ffffffff81570510>] do_loop_readv_writev fs/read_write.c:880 [inline]
[<ffffffff81570510>] do_readv_writev+0x520/0x750 fs/read_write.c:874
[<ffffffff815707c4>] vfs_readv+0x84/0xc0 fs/read_write.c:898
[<ffffffff815708e6>] do_readv+0xe6/0x250 fs/read_write.c:924
[<ffffffff81573dd7>] SYSC_readv fs/read_write.c:1011 [inline]
[<ffffffff81573dd7>] SyS_readv+0x27/0x30 fs/read_write.c:1008
[<ffffffff838b2c6e>] entry_SYSCALL_64_fastpath+0x29/0xe8
Code: e9 27 fc ff ff 0f 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 55 48 89
e5 53 48 89 fb 48 83 c7 1c 48 89 fa 48 83 ec 08 48 c1 ea 03 <0f> b6 14 02
48 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 3d
RIP [<ffffffff8144ede1>] __read_once_size include/linux/compiler.h:243
[inline]
RIP [<ffffffff8144ede1>] atomic_read arch/x86/include/asm/atomic.h:26
[inline]
RIP [<ffffffff8144ede1>] page_ref_count include/linux/page_ref.h:66
[inline]
RIP [<ffffffff8144ede1>] put_page_testzero include/linux/mm.h:450 [inline]
RIP [<ffffffff8144ede1>] __free_pages+0x21/0x80 mm/page_alloc.c:3903
RSP <ffff8801d37879b0>
---[ end trace 528458f4c2f2525e ]---


---
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.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages