syzbot


WARNING: ODEBUG bug in vsock_stream_connect

Status: fixed on 2018/08/28 17:48
Subsystems: net virt
[Documentation on labels]
Reported-by: syzbot+8a9b1bd330476a4f3db6@syzkaller.appspotmail.com
Fix commit: 455f05ecd2b2 vsock: split dwork to avoid reinitializations
First crash: 2318d, last: 2309d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 3.16 000/366] 3.16.61-rc1 review 375 (376) 2019/01/02 17:44
[PATCH 3.18 00/56] 3.18.120-stable review 58 (58) 2018/08/27 19:30
[PATCH 4.4 00/22] 4.4.151-stable review 26 (26) 2018/08/21 22:01
[PATCH 4.9 00/25] 4.9.123-stable review 31 (31) 2018/08/21 22:00
[PATCH 4.14 00/29] 4.14.66-stable review 33 (33) 2018/08/21 19:49
[PATCH 4.17 00/42] 4.17.18-stable review 46 (46) 2018/08/21 19:44
[Patch net] vsock: split dwork to avoid reinitializations 2 (2) 2018/08/07 19:39
WARNING: ODEBUG bug in vsock_stream_connect 0 (3) 2018/07/31 06:45

Sample crash report:
------------[ cut here ]------------
ODEBUG: init active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x90 kernel/workqueue.c:1414
WARNING: CPU: 1 PID: 21936 at lib/debugobjects.c:329 debug_print_object+0x16a/0x210 lib/debugobjects.c:326
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 21936 Comm: syz-executor309 Not tainted 4.18.0-rc7+ #176
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
 panic+0x238/0x4e7 kernel/panic.c:184
 __warn.cold.8+0x163/0x1ba kernel/panic.c:536
 report_bug+0x252/0x2d0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:992
RIP: 0010:debug_print_object+0x16a/0x210 lib/debugobjects.c:326
Code: 3a 87 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 92 00 00 00 48 8b 14 dd a0 74 3a 87 4c 89 f6 48 c7 c7 40 6a 3a 87 e8 c6 af e6 fd <0f> 0b 83 05 29 e6 29 05 01 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 
RSP: 0018:ffff8801d7fcf658 EFLAGS: 00010082
RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81632481 RDI: 0000000000000001
RBP: ffff8801d7fcf698 R08: ffff8801b718c540 R09: ffffed003b623ec2
R10: ffffed003b623ec2 R11: ffff8801db11f617 R12: 0000000000000001
R13: ffffffff87f9c9e0 R14: ffffffff873a7040 R15: ffffffff816918a0
 __debug_object_init+0x8e9/0x12e0 lib/debugobjects.c:403
 debug_object_init+0x16/0x20 lib/debugobjects.c:429
 debug_timer_init kernel/time/timer.c:704 [inline]
 debug_init kernel/time/timer.c:757 [inline]
 init_timer_key+0xa9/0x490 kernel/time/timer.c:806
 vsock_stream_connect+0xc7a/0xfc0 net/vmw_vsock/af_vsock.c:1224
 __sys_connect+0x37d/0x4c0 net/socket.c:1674
 __do_sys_connect net/socket.c:1685 [inline]
 __se_sys_connect net/socket.c:1682 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1682
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x445d59
Code: e8 ac e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007fd454b98da8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00000000006dac38 RCX: 0000000000445d59
RDX: 0000000000000010 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00000000006dac30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac3c
R13: 6b636f73762d7473 R14: 6f68762f7665642f R15: 0000000000000001

======================================================
WARNING: possible circular locking dependency detected
4.18.0-rc7+ #176 Not tainted
------------------------------------------------------
syz-executor309/21936 is trying to acquire lock:
000000006d7c0d55 ((console_sem).lock){-...}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
00000000a388f8a0 (&obj_hash[i].lock){-.-.}, at: __debug_object_init+0x127/0x12e0 lib/debugobjects.c:381

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&obj_hash[i].lock){-.-.}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
       __debug_object_init+0x127/0x12e0 lib/debugobjects.c:381
       debug_object_init+0x16/0x20 lib/debugobjects.c:429
       debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
       debug_init kernel/time/hrtimer.c:458 [inline]
       hrtimer_init+0x97/0x480 kernel/time/hrtimer.c:1308
       init_dl_task_timer+0x1b/0x50 kernel/sched/deadline.c:1056
       __sched_fork+0x2ae/0x590 kernel/sched/core.c:2185
       init_idle+0x75/0x7a0 kernel/sched/core.c:5405
       sched_init+0xbf3/0xd2c kernel/sched/core.c:6103
       start_kernel+0x47d/0x949 init/main.c:602
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:452
       x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:433
       secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:242

-> #2 (&rq->lock){-.-.}:
       __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
       _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
       rq_lock kernel/sched/sched.h:1812 [inline]
       task_fork_fair+0x93/0x680 kernel/sched/fair.c:9952
       sched_fork+0x446/0xb40 kernel/sched/core.c:2381
       copy_process.part.39+0x1bf5/0x70b0 kernel/fork.c:1796
       copy_process kernel/fork.c:1639 [inline]
       _do_fork+0x291/0x12a0 kernel/fork.c:2122
       kernel_thread+0x34/0x40 kernel/fork.c:2181
       rest_init+0x22/0xe4 init/main.c:408
       start_kernel+0x90e/0x949 init/main.c:738
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:452
       x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:433
       secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:242

-> #1 (&p->pi_lock){-.-.}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
       try_to_wake_up+0xd2/0x12a0 kernel/sched/core.c:1985
       wake_up_process+0x10/0x20 kernel/sched/core.c:2148
       __up.isra.1+0x1c0/0x2a0 kernel/locking/semaphore.c:262
       up+0x13c/0x1c0 kernel/locking/semaphore.c:187
       __up_console_sem+0xbe/0x1b0 kernel/printk/printk.c:242
       console_unlock+0x7a2/0x10b0 kernel/printk/printk.c:2411
       do_con_write+0x12cc/0x22a0 drivers/tty/vt/vt.c:2435
       con_write+0x25/0xc0 drivers/tty/vt/vt.c:2784
       process_output_block drivers/tty/n_tty.c:580 [inline]
       n_tty_write+0x6c1/0x11a0 drivers/tty/n_tty.c:2317
       do_tty_write drivers/tty/tty_io.c:963 [inline]
       tty_write+0x45f/0xae0 drivers/tty/tty_io.c:1051
       __vfs_write+0x117/0x9f0 fs/read_write.c:485
       vfs_write+0x1f8/0x560 fs/read_write.c:549
       ksys_write+0x101/0x260 fs/read_write.c:598
       __do_sys_write fs/read_write.c:610 [inline]
       __se_sys_write fs/read_write.c:607 [inline]
       __x64_sys_write+0x73/0xb0 fs/read_write.c:607
       do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 ((console_sem).lock){-...}:
       lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
       down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
       __down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
       console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
       console_trylock_spinning kernel/printk/printk.c:1643 [inline]
       vprintk_emit+0x6ad/0xdf0 kernel/printk/printk.c:1906
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
       vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
       printk+0xa7/0xcf kernel/printk/printk.c:1981
       __warn_printk+0x8c/0xe0 kernel/panic.c:590
       debug_print_object+0x16a/0x210 lib/debugobjects.c:326
       __debug_object_init+0x8e9/0x12e0 lib/debugobjects.c:403
       debug_object_init+0x16/0x20 lib/debugobjects.c:429
       debug_timer_init kernel/time/timer.c:704 [inline]
       debug_init kernel/time/timer.c:757 [inline]
       init_timer_key+0xa9/0x490 kernel/time/timer.c:806
       vsock_stream_connect+0xc7a/0xfc0 net/vmw_vsock/af_vsock.c:1224
       __sys_connect+0x37d/0x4c0 net/socket.c:1674
       __do_sys_connect net/socket.c:1685 [inline]
       __se_sys_connect net/socket.c:1682 [inline]
       __x64_sys_connect+0x73/0xb0 net/socket.c:1682
       do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Chain exists of:
  (console_sem).lock --> &rq->lock --> &obj_hash[i].lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&obj_hash[i].lock);
                               lock(&rq->lock);
                               lock(&obj_hash[i].lock);
  lock((console_sem).lock);

 *** DEADLOCK ***

2 locks held by syz-executor309/21936:
 #0: 00000000e40c0aaf (sk_lock-AF_VSOCK){+.+.}, at: lock_sock include/net/sock.h:1474 [inline]
 #0: 00000000e40c0aaf (sk_lock-AF_VSOCK){+.+.}, at: vsock_stream_connect+0x1e3/0xfc0 net/vmw_vsock/af_vsock.c:1152
 #1: 00000000a388f8a0 (&obj_hash[i].lock){-.-.}, at: __debug_object_init+0x127/0x12e0 lib/debugobjects.c:381

stack backtrace:
CPU: 1 PID: 21936 Comm: syz-executor309 Not tainted 4.18.0-rc7+ #176
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
 print_circular_bug.isra.36.cold.57+0x1bd/0x27d kernel/locking/lockdep.c:1227
 check_prev_add kernel/locking/lockdep.c:1867 [inline]
 check_prevs_add kernel/locking/lockdep.c:1980 [inline]
 validate_chain kernel/locking/lockdep.c:2421 [inline]
 __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3435
 lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
 down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
 __down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
 console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
 console_trylock_spinning kernel/printk/printk.c:1643 [inline]
 vprintk_emit+0x6ad/0xdf0 kernel/printk/printk.c:1906
 vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
 vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
 printk+0xa7/0xcf kernel/printk/printk.c:1981
 __warn_printk+0x8c/0xe0 kernel/panic.c:590
 debug_print_object+0x16a/0x210 lib/debugobjects.c:326
 __debug_object_init+0x8e9/0x12e0 lib/debugobjects.c:403
 debug_object_init+0x16/0x20 lib/debugobjects.c:429
 debug_timer_init kernel/time/timer.c:704 [inline]
 debug_init kernel/time/timer.c:757 [inline]
 init_timer_key+0xa9/0x490 kernel/time/timer.c:806
 vsock_stream_connect+0xc7a/0xfc0 net/vmw_vsock/af_vsock.c:1224
 __sys_connect+0x37d/0x4c0 net/socket.c:1674
 __do_sys_connect net/socket.c:1685 [inline]
 __se_sys_connect net/socket.c:1682 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1682
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x445d59
Code: e8 ac e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007fd454b98da8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00000000006dac38 RCX: 0000000000445d59
RDX: 0000000000000010 RSI: 0000000020000200 RDI: 0000000000000004
RBP: 00000000006dac30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac3c
R13: 6b636f73762d7473 R14: 6f68762f7665642f R15: 0000000000000001
Shutting down cpus with NMI
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (42):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/08/04 01:43 upstream 0b5b1f9a78b5 df7f6947 .config console log report syz C ci-upstream-kasan-gce-root
2018/08/04 00:39 upstream 0b5b1f9a78b5 df7f6947 .config console log report syz C ci-upstream-kasan-gce
2018/07/31 15:03 upstream 527838d470e3 1a381291 .config console log report syz C ci-upstream-kasan-gce-root
2018/07/31 06:44 upstream 527838d470e3 1a381291 .config console log report syz C ci-upstream-kasan-gce
2018/08/04 00:39 upstream 0b5b1f9a78b5 df7f6947 .config console log report syz ci-upstream-kasan-gce-386
2018/07/31 05:46 upstream 527838d470e3 1a381291 .config console log report syz ci-upstream-kasan-gce-386
2018/08/04 02:18 linux-next 116b181bb646 df7f6947 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/07/31 08:55 linux-next d1e0b8e0cb7a 1a381291 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/08/07 02:26 upstream 1236568ee3cb 1beb8136 .config console log report ci-upstream-kasan-gce-root
2018/08/07 00:30 upstream 1ffaddd029c8 1beb8136 .config console log report ci-upstream-kasan-gce
2018/08/06 20:09 upstream 1ffaddd029c8 1beb8136 .config console log report ci-upstream-kasan-gce
2018/08/06 00:09 upstream a8c199208cd6 1beb8136 .config console log report ci-upstream-kasan-gce
2018/08/04 23:11 upstream 0b5b1f9a78b5 3476a2df .config console log report ci-upstream-kasan-gce-root
2018/08/03 08:22 upstream e30cb13c5a09 5b7e23bb .config console log report ci-upstream-kasan-gce
2018/08/03 07:48 upstream e30cb13c5a09 5b7e23bb .config console log report ci-upstream-kasan-gce-root
2018/08/03 01:22 upstream e30cb13c5a09 5b7e23bb .config console log report ci-upstream-kasan-gce
2018/08/02 16:52 upstream 6b4703768268 0a7cf4ec .config console log report ci-upstream-kasan-gce-root
2018/08/02 12:49 upstream 6b4703768268 0a7cf4ec .config console log report ci-upstream-kasan-gce
2018/08/02 07:26 upstream 6b4703768268 0a7cf4ec .config console log report ci-upstream-kasan-gce
2018/08/01 19:13 upstream 44960f2a7b63 0a7cf4ec .config console log report ci-upstream-kasan-gce
2018/08/01 03:57 upstream c1d61e7fe376 1477993e .config console log report ci-upstream-kasan-gce
2018/07/31 23:59 upstream c1d61e7fe376 1477993e .config console log report ci-upstream-kasan-gce
2018/07/31 17:41 upstream c1d61e7fe376 1a381291 .config console log report ci-upstream-kasan-gce-root
2018/07/31 11:32 upstream 527838d470e3 1a381291 .config console log report ci-upstream-kasan-gce-root
2018/08/08 17:47 upstream 1236568ee3cb ddeb9f8d .config console log report ci-upstream-kasan-gce-386
2018/08/03 17:58 upstream 0585df468e8f cc4f6d0a .config console log report ci-upstream-kasan-gce-386
2018/08/02 23:40 upstream e30cb13c5a09 5b7e23bb .config console log report ci-upstream-kasan-gce-386
2018/08/02 16:58 upstream 6b4703768268 0a7cf4ec .config console log report ci-upstream-kasan-gce-386
2018/08/01 07:21 upstream c1d61e7fe376 1477993e .config console log report ci-upstream-kasan-gce-386
2018/07/31 20:37 upstream c1d61e7fe376 1477993e .config console log report ci-upstream-kasan-gce-386
2018/07/31 08:45 upstream 527838d470e3 1a381291 .config console log report ci-upstream-kasan-gce-386
2018/07/31 04:00 upstream 527838d470e3 1a381291 .config console log report ci-upstream-kasan-gce-386
2018/07/30 11:27 upstream acb1872577b3 1a381291 .config console log report ci-upstream-kasan-gce-386
2018/07/30 09:06 upstream 3cfb6772d4cf 1a381291 .config console log report ci-upstream-kasan-gce-386
2018/08/08 07:28 linux-next 2b769bb85b48 1beb8136 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/07 06:33 linux-next 8c8399e0a3fb 1beb8136 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/06 08:30 linux-next 116b181bb646 1beb8136 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/05 14:47 linux-next 116b181bb646 1beb8136 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/04 12:26 linux-next 116b181bb646 df7f6947 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/04 11:52 linux-next 116b181bb646 df7f6947 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/04 05:00 linux-next 116b181bb646 df7f6947 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/03 02:46 linux-next d237c54d5b28 5b7e23bb .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.