syzbot


BUG: spinlock bad magic

Status: public: reported C repro on 2019/04/13 00:00
Reported-by: syzbot+2ff455ba2e474183f1d5@syzkaller.appspotmail.com
First crash: 2537d, last: 2483d
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
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
android-49 BUG: spinlock bad magic (2) C 52 2480d 2050d 0/3 public: reported C repro on 2019/04/12 00:00

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
BUG: spinlock bad magic on CPU#1, syzkaller793893/3324
 lock: 0xffff8801cb454218, .magic: dead4eac, .owner: <none>/-1, .owner_cpu: -1
CPU: 1 PID: 3324 Comm: syzkaller793893 Not tainted 4.4.111-g7902639 #18
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 6d3fbb10b5a99f7c ffff8801db3078d8 ffffffff81d0509d
 ffff8801cb454218 ffff8801d122af80 0000000000000001 0000000000000001
 0000000000000000 ffff8801db307918 ffffffff81245acd 0000000000000000
Call Trace:
 <IRQ>  [<ffffffff81d0509d>] __dump_stack lib/dump_stack.c:15 [inline]
 <IRQ>  [<ffffffff81d0509d>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff81245acd>] spin_dump+0x14d/0x280 kernel/locking/spinlock_debug.c:67
 [<ffffffff81245eb8>] spin_bug kernel/locking/spinlock_debug.c:75 [inline]
 [<ffffffff81245eb8>] debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 [<ffffffff81245eb8>] do_raw_spin_lock+0x228/0x2c0 kernel/locking/spinlock_debug.c:135
 [<ffffffff83775476>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:119 [inline]
 [<ffffffff83775476>] _raw_spin_lock_irqsave+0x56/0x70 kernel/locking/spinlock.c:159
 [<ffffffff8121e88e>] __wake_up+0x1e/0x50 kernel/sched/wait.c:94
 [<ffffffff825bd53c>] sg_rq_end_io+0x5dc/0xbc0 drivers/scsi/sg.c:1396
 [<ffffffff81c99de4>] __blk_mq_end_request+0x54/0xc0 block/blk-mq.c:311
 [<ffffffff82525295>] scsi_end_request+0x135/0x5b0 drivers/scsi/scsi_lib.c:716
 [<ffffffff8252e4e3>] scsi_io_completion+0x15c3/0x1710 drivers/scsi/scsi_lib.c:918
 [<ffffffff825119ff>] scsi_finish_command+0x3af/0x520 drivers/scsi/scsi.c:607
 [<ffffffff8252bbe0>] scsi_softirq_done+0x250/0x350 drivers/scsi/scsi_lib.c:1654
 [<ffffffff81c9c045>] blk_mq_ipi_complete_request block/blk-mq.c:356 [inline]
 [<ffffffff81c9c045>] __blk_mq_complete_request+0x205/0x500 block/blk-mq.c:368
 [<ffffffff81c9c39b>] blk_mq_complete_request+0x5b/0x70 block/blk-mq.c:387
 [<ffffffff825288bb>] scsi_mq_done+0xfb/0x3c0 drivers/scsi/scsi_lib.c:1964
 [<ffffffff825517af>] virtscsi_complete_cmd+0x5cf/0x7f0 drivers/scsi/virtio_scsi.c:210
 [<ffffffff8254f4c9>] virtscsi_vq_done+0xc9/0x170 drivers/scsi/virtio_scsi.c:228
 [<ffffffff8254f617>] virtscsi_req_done+0xa7/0xd0 drivers/scsi/virtio_scsi.c:243
 [<ffffffff81f2d9f9>] vring_interrupt+0x109/0x150 drivers/virtio/virtio_ring.c:722
 [<ffffffff8126d2a1>] handle_irq_event_percpu+0xf1/0x960 kernel/irq/handle.c:146
 [<ffffffff8126dbb7>] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:194
 [<ffffffff8127793a>] handle_edge_irq+0x1fa/0x8e0 kernel/irq/chip.c:623
 [<ffffffff81016900>] generic_handle_irq_desc include/linux/irqdesc.h:140 [inline]
 [<ffffffff81016900>] handle_irq+0x250/0x3a0 arch/x86/kernel/irq_64.c:78
 [<ffffffff83778359>] do_IRQ+0x89/0x1b0 arch/x86/kernel/irq.c:239
 [<ffffffff83776420>] common_interrupt+0xa0/0xa0 arch/x86/entry/entry_64.S:580
 <EOI>  [<ffffffff81435de3>] ? constant_test_bit arch/x86/include/asm/bitops.h:311 [inline]
 <EOI>  [<ffffffff81435de3>] ? PageSlab include/linux/page-flags.h:217 [inline]
 <EOI>  [<ffffffff81435de3>] ? page_mapcount include/linux/mm.h:460 [inline]
 <EOI>  [<ffffffff81435de3>] ? check_new_page mm/page_alloc.c:1407 [inline]
 <EOI>  [<ffffffff81435de3>] ? prep_new_page mm/page_alloc.c:1439 [inline]
 <EOI>  [<ffffffff81435de3>] ? get_page_from_freelist+0x793/0x1a70 mm/page_alloc.c:2664
 [<ffffffff814375d7>] __alloc_pages_nodemask+0x2c7/0x16e0 mm/page_alloc.c:3305
 [<ffffffff8150d395>] __alloc_pages include/linux/gfp.h:415 [inline]
 [<ffffffff8150d395>] __alloc_pages_node include/linux/gfp.h:428 [inline]
 [<ffffffff8150d395>] alloc_pages_node include/linux/gfp.h:442 [inline]
 [<ffffffff8150d395>] do_huge_pmd_anonymous_page+0x205/0xa10 mm/huge_memory.c:862
 [<ffffffff814a1c0a>] create_huge_pmd mm/memory.c:3242 [inline]
 [<ffffffff814a1c0a>] __handle_mm_fault mm/memory.c:3361 [inline]
 [<ffffffff814a1c0a>] handle_mm_fault+0x271a/0x3190 mm/memory.c:3455
 [<ffffffff810dc6bb>] __do_page_fault+0x35b/0xa00 arch/x86/mm/fault.c:1245
 [<ffffffff810dcd87>] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308
 [<ffffffff83776cc8>] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1021
kasan: GPF could be caused by NULL-ptr deref or user memory access
kasan: CONFIG_KASAN_INLINE enabledkasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3322 Comm: syzkaller793893 Not tainted 4.4.111-g7902639 #18
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8801d23a17c0 task.stack: ffff8801d0a00000
RIP: 0010:[<ffffffff81433621>]  [<ffffffff81433621>] __read_once_size include/linux/compiler.h:218 [inline]
RIP: 0010:[<ffffffff81433621>]  [<ffffffff81433621>] atomic_read arch/x86/include/asm/atomic.h:27 [inline]
RIP: 0010:[<ffffffff81433621>]  [<ffffffff81433621>] put_page_testzero include/linux/mm.h:357 [inline]
RIP: 0010:[<ffffffff81433621>]  [<ffffffff81433621>] __free_pages+0x21/0x90 mm/page_alloc.c:3365
RSP: 0018:ffff8801d0a07970  EFLAGS: 00010a07
RAX: dffffc0000000000 RBX: dead4ead00000000 RCX: ffffffff825b9ebb
RDX: 1bd5a9d5a0000003 RSI: 0000000000000001 RDI: dead4ead0000001c
RBP: ffff8801d0a07980 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 1ffff1003a140f0c R12: 0000000000000004
R13: 0000000000000020 R14: ffff8801cb47c200 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8801db300000(0063) knlGS:0000000008d79900
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 0000000020b16000 CR3: 00000001d12a6000 CR4: 0000000000160670
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
 0000000000000246 ffff8801cb47c358 ffff8801d0a079e0 ffffffff825b9ee1
 ffff8801cb47c370 ffffed003968f86b ffffed003968f86e ffff8801cb47c368
 dead4ead00000000 ffff8801cb47c340 0000000000000000 0000000000000000
Call Trace:
 [<ffffffff825b9ee1>] sg_remove_scat.isra.17+0x1c1/0x2d0 drivers/scsi/sg.c:1964
 [<ffffffff825ba2a5>] sg_finish_rem_req+0x2b5/0x340 drivers/scsi/sg.c:1846
 [<ffffffff825ba666>] sg_new_read.isra.18+0x336/0x3c0 drivers/scsi/sg.c:578
 [<ffffffff825bbf62>] sg_read+0x8c2/0x1490 drivers/scsi/sg.c:467
 [<ffffffff8151cc51>] do_loop_readv_writev+0x141/0x1e0 fs/read_write.c:680
 [<ffffffff8151f7ef>] compat_do_readv_writev+0x5df/0x6e0 fs/read_write.c:984
 [<ffffffff8151f9c9>] compat_readv+0xd9/0x140 fs/read_write.c:1013
 [<ffffffff81521d58>] C_SYSC_readv fs/read_write.c:1033 [inline]
 [<ffffffff81521d58>] compat_SyS_readv+0xd8/0x1b0 fs/read_write.c:1022
 [<ffffffff81006d84>] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline]
 [<ffffffff81006d84>] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457
 [<ffffffff8377722a>] sysenter_flags_fixed+0xd/0x17
Code: 96 a4 0c 00 e9 78 fd ff ff 90 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 49 
RIP  [<ffffffff81433621>] __read_once_size include/linux/compiler.h:218 [inline]
RIP  [<ffffffff81433621>] atomic_read arch/x86/include/asm/atomic.h:27 [inline]
RIP  [<ffffffff81433621>] put_page_testzero include/linux/mm.h:357 [inline]
RIP  [<ffffffff81433621>] __free_pages+0x21/0x90 mm/page_alloc.c:3365
 RSP <ffff8801d0a07970>
---[ end trace f075a076e6d0a1ec ]---

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/13 14:08 https://android.googlesource.com/kernel/common android-4.4 7902639f8133 c9e7aeae .config console log report syz C ci-android-44-kasan-gce-386
2018/01/13 05:33 https://android.googlesource.com/kernel/common android-4.4 7902639f8133 9dc808a6 .config console log report syz C ci-android-44-kasan-gce-386
2018/01/12 02:17 https://android.googlesource.com/kernel/common android-4.4 3301b5569f27 9dc808a6 .config console log report syz C ci-android-44-kasan-gce
2018/01/01 09:49 https://android.googlesource.com/kernel/common android-4.4 610c835673f3 00193447 .config console log report syz C ci-android-44-kasan-gce-386
2018/01/19 22:59 https://android.googlesource.com/kernel/common android-4.4 d96d95dd1d8b fbbdcd92 .config console log report ci-android-44-kasan-gce
2018/01/11 12:51 https://android.googlesource.com/kernel/common android-4.4 f8518889ffe8 9dc808a6 .config console log report ci-android-44-kasan-gce-386
2018/01/07 00:20 https://android.googlesource.com/kernel/common android-4.4 d891a62401ae 053171ea .config console log report ci-android-44-kasan-gce
2018/01/05 18:12 https://android.googlesource.com/kernel/common android-4.4 610c835673f3 00193447 .config console log report ci-android-44-kasan-gce
2018/01/04 22:02 https://android.googlesource.com/kernel/common android-4.4 610c835673f3 00193447 .config console log report ci-android-44-kasan-gce-386
2017/12/18 14:30 https://android.googlesource.com/kernel/common android-4.4 2fea0397a8e7 1c4160ef .config console log report ci-android-44-kasan-gce
2017/12/16 10:55 https://android.googlesource.com/kernel/common android-4.4 dcfa5fe36a67 b6f0c91b .config console log report ci-android-44-kasan-gce
2017/12/12 00:50 https://android.googlesource.com/kernel/common android-4.4 36205b7fa963 da131727 .config console log report ci-android-44-kasan-gce
2017/12/11 01:15 https://android.googlesource.com/kernel/common android-4.4 8a5396242ea0 5ad0ce95 .config console log report ci-android-44-kasan-gce
2018/02/03 12:05 https://android.googlesource.com/kernel/common android-4.4 4e74e983ab6e 632a8c2c .config console log report ci-android-44-kasan-gce-386
2018/02/02 03:52 https://android.googlesource.com/kernel/common android-4.4 a81d32264721 67bd3383 .config console log report ci-android-44-kasan-gce-386
2018/01/19 13:45 https://android.googlesource.com/kernel/common android-4.4 52c02cf1b2a2 161c1d64 .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.