syzbot


BUG: spinlock bad magic (2)

Status: public: reported C repro on 2019/04/12 00:00
Reported-by: syzbot+d0746f81dc928e6c4904@syzkaller.appspotmail.com
First crash: 2572d, last: 2480d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 BUG: spinlock bad magic 1 2573d 2573d 0/3 closed as invalid on 2017/11/05 07:52
android-44 BUG: spinlock bad magic C 16 2483d 2049d 0/2 public: reported C repro on 2019/04/13 00:00
upstream BUG: spinlock bad magic (2) rds 7 2529d 2530d 0/28 closed as dup on 2018/01/30 22:28
upstream BUG: spinlock bad magic C 6 2614d 2631d 0/28 closed as invalid on 2017/10/18 08:55

Sample crash report:
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 ]---

Crashes (52):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/30 08:49 https://android.googlesource.com/kernel/common android-4.9 7be198545491 08d47756 .config console log report syz C ci-android-49-kasan-gce
2018/01/09 08:05 https://android.googlesource.com/kernel/common android-4.9 b54d99aa12b4 11dc42f6 .config console log report syz C ci-android-49-kasan-gce-386
2017/12/17 23:23 https://android.googlesource.com/kernel/common android-4.9 3f1d77ca5f8f d5beb42a .config console log report syz C ci-android-49-kasan-gce-386
2017/12/15 01:39 https://android.googlesource.com/kernel/common android-4.9 3f1d77ca5f8f ac20b98c .config console log report syz C ci-android-49-kasan-gce-386
2017/11/07 06:56 https://android.googlesource.com/kernel/common android-4.9 dfe0a9bcfc3a d49979f7 .config console log report syz ci-android-49-kasan-gce
2018/02/06 12:16 https://android.googlesource.com/kernel/common android-4.9 b30d2b5deba5 a1bc9d40 .config console log report ci-android-49-kasan-gce
2018/01/27 11:21 https://android.googlesource.com/kernel/common android-4.9 68d447c0a37b 1d18b112 .config console log report ci-android-49-kasan-gce
2018/01/26 12:09 https://android.googlesource.com/kernel/common android-4.9 f518fe49bbaa 1d18b112 .config console log report ci-android-49-kasan-gce
2018/01/21 23:17 https://android.googlesource.com/kernel/common android-4.9 e12a9c4458ff fbbdcd92 .config console log report ci-android-49-kasan-gce
2018/01/21 10:35 https://android.googlesource.com/kernel/common android-4.9 e12a9c4458ff fbbdcd92 .config console log report ci-android-49-kasan-gce
2018/01/18 00:42 https://android.googlesource.com/kernel/common android-4.9 033d019ce29c b8970f31 .config console log report ci-android-49-kasan-gce
2018/01/17 07:18 https://android.googlesource.com/kernel/common android-4.9 8dec074e888a a46e5318 .config console log report ci-android-49-kasan-gce-386
2018/01/16 20:00 https://android.googlesource.com/kernel/common android-4.9 8dec074e888a a46e5318 .config console log report ci-android-49-kasan-gce
2018/01/16 04:46 https://android.googlesource.com/kernel/common android-4.9 8dec074e888a e17f4a5d .config console log report ci-android-49-kasan-gce
2018/01/16 04:20 https://android.googlesource.com/kernel/common android-4.9 8dec074e888a e17f4a5d .config console log report ci-android-49-kasan-gce
2018/01/14 13:56 https://android.googlesource.com/kernel/common android-4.9 f0f6293fd01a c9e7aeae .config console log report ci-android-49-kasan-gce
2018/01/14 11:18 https://android.googlesource.com/kernel/common android-4.9 f0f6293fd01a c9e7aeae .config console log report ci-android-49-kasan-gce
2018/01/11 10:22 https://android.googlesource.com/kernel/common android-4.9 91549408ceb8 02a19b64 .config console log report ci-android-49-kasan-gce
2018/01/10 08:05 https://android.googlesource.com/kernel/common android-4.9 8910fa508811 1f60c828 .config console log report ci-android-49-kasan-gce
2018/01/10 01:30 https://android.googlesource.com/kernel/common android-4.9 8910fa508811 1f60c828 .config console log report ci-android-49-kasan-gce
2018/01/09 14:45 https://android.googlesource.com/kernel/common android-4.9 8910fa508811 11dc42f6 .config console log report ci-android-49-kasan-gce
2018/01/07 09:56 https://android.googlesource.com/kernel/common android-4.9 5f5e5d4041e3 19c05fff .config console log report ci-android-49-kasan-gce
2018/01/06 10:37 https://android.googlesource.com/kernel/common android-4.9 bc7ff9b9988f 00193447 .config console log report ci-android-49-kasan-gce
2018/01/05 15:03 https://android.googlesource.com/kernel/common android-4.9 173c52eae928 00193447 .config console log report ci-android-49-kasan-gce
2018/01/05 14:58 https://android.googlesource.com/kernel/common android-4.9 173c52eae928 00193447 .config console log report ci-android-49-kasan-gce
2018/01/04 17:26 https://android.googlesource.com/kernel/common android-4.9 173c52eae928 00193447 .config console log report ci-android-49-kasan-gce
2018/01/04 12:51 https://android.googlesource.com/kernel/common android-4.9 173c52eae928 00193447 .config console log report ci-android-49-kasan-gce
2017/12/31 14:23 https://android.googlesource.com/kernel/common android-4.9 f3f3457d4582 00193447 .config console log report ci-android-49-kasan-gce-386
2017/12/29 13:36 https://android.googlesource.com/kernel/common android-4.9 cb7518e6167c 7d240098 .config console log report ci-android-49-kasan-gce
2017/12/29 03:49 https://android.googlesource.com/kernel/common android-4.9 cb7518e6167c 7d240098 .config console log report ci-android-49-kasan-gce
2017/12/29 03:12 https://android.googlesource.com/kernel/common android-4.9 cb7518e6167c 7d240098 .config console log report ci-android-49-kasan-gce-386
2017/12/27 17:17 https://android.googlesource.com/kernel/common android-4.9 cb7518e6167c 09c8f4c0 .config console log report ci-android-49-kasan-gce-386
2017/12/27 14:05 https://android.googlesource.com/kernel/common android-4.9 cb7518e6167c 09c8f4c0 .config console log report ci-android-49-kasan-gce
2017/12/27 00:15 https://android.googlesource.com/kernel/common android-4.9 250637879165 73aba437 .config console log report ci-android-49-kasan-gce
2017/12/26 19:10 https://android.googlesource.com/kernel/common android-4.9 250637879165 73aba437 .config console log report ci-android-49-kasan-gce-386
2017/12/26 11:38 https://android.googlesource.com/kernel/common android-4.9 250637879165 73aba437 .config console log report ci-android-49-kasan-gce
2017/12/22 16:21 https://android.googlesource.com/kernel/common android-4.9 250637879165 81fe66b4 .config console log report ci-android-49-kasan-gce
2017/12/20 05:32 https://android.googlesource.com/kernel/common android-4.9 c14c7b37e933 2d836b1d .config console log report ci-android-49-kasan-gce
2017/12/19 21:02 https://android.googlesource.com/kernel/common android-4.9 c14c7b37e933 af9163c7 .config console log report ci-android-49-kasan-gce
2017/12/18 14:33 https://android.googlesource.com/kernel/common android-4.9 9542d2a0126e 1c4160ef .config console log report ci-android-49-kasan-gce-386
2017/12/09 04:15 https://android.googlesource.com/kernel/common android-4.9 f26d3c76d376 5ad0ce95 .config console log report ci-android-49-kasan-gce
2017/12/07 02:35 https://android.googlesource.com/kernel/common android-4.9 f26d3c76d376 5d643f8e .config console log report ci-android-49-kasan-gce
2017/12/06 20:03 https://android.googlesource.com/kernel/common android-4.9 f26d3c76d376 5d643f8e .config console log report ci-android-49-kasan-gce
2017/11/30 22:26 https://android.googlesource.com/kernel/common android-4.9 5311c740c0ed 5153aeaf .config console log report ci-android-49-kasan-gce
2017/11/30 17:15 https://android.googlesource.com/kernel/common android-4.9 5311c740c0ed 5153aeaf .config console log report ci-android-49-kasan-gce
* Struck through repros no longer work on HEAD.