syzbot


WARNING in __debug_object_init

Status: fixed on 2018/05/08 18:30
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+a3e0726462b2e346a31d@syzkaller.appspotmail.com
Fix commit: bd03143007eb alarmtimer: Init nanosleep alarm timer on stack
First crash: 2455d, last: 2444d
Discussions (4)
Title Replies (including bot) Last reply
[PATCH 4.14 000/183] 4.14.37-stable review 193 (193) 2018/04/26 06:59
[PATCH 4.16 00/26] 4.16.5-stable review 34 (34) 2018/04/26 06:59
[PATCH] alarmtimer: Init nanosleep alarm timer on stack 4 (4) 2018/03/29 14:13
WARNING in __debug_object_init 0 (1) 2018/03/26 00:01
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in __debug_object_init (2) bpf net C 1780 2242d 2247d 0/28 closed as invalid on 2018/10/24 02:07
upstream WARNING in __debug_object_init (3) bpf net C 1557 2237d 2238d 11/28 fixed on 2019/01/21 10:28
android-49 WARNING in __debug_object_init C 8315 2047d 2072d 0/3 public: reported C repro on 2019/04/12 00:00

Sample crash report:
ODEBUG: object is on stack, but not annotated
WARNING: CPU: 0 PID: 4185 at lib/debugobjects.c:328 debug_object_is_on_stack lib/debugobjects.c:327 [inline]
WARNING: CPU: 0 PID: 4185 at lib/debugobjects.c:328 __debug_object_init+0x60a/0x1040 lib/debugobjects.c:354
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 4185 Comm: syzkaller382398 Not tainted 4.16.0-rc6+ #1
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/0x24d lib/dump_stack.c:53
 panic+0x1e4/0x41c kernel/panic.c:183
 __warn+0x1dc/0x200 kernel/panic.c:547
 report_bug+0x1f4/0x2b0 lib/bug.c:186
 fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
 fixup_bug arch/x86/kernel/traps.c:247 [inline]
 do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
RIP: 0010:debug_object_is_on_stack lib/debugobjects.c:327 [inline]
RIP: 0010:__debug_object_init+0x60a/0x1040 lib/debugobjects.c:354
RSP: 0018:ffff8801b8aff968 EFLAGS: 00010082
RAX: 000000000000002d RBX: 0000000000000001 RCX: 0000000000000000
RDX: 000000000000002d RSI: 1ffff1003715fee2 RDI: ffffed003715ff21
RBP: ffff8801b8affb40 R08: 0000000000000000 R09: 1ffff1003715fe89
R10: ffff8801b8aff820 R11: ffffffff86f39cb8 R12: ffff8801c8daa0c0
R13: ffff8801b8affca0 R14: ffff8801c0c65310 R15: ffff8801c0c65320
 debug_object_init+0x17/0x20 lib/debugobjects.c:391
 debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
 debug_init kernel/time/hrtimer.c:458 [inline]
 hrtimer_init+0x8c/0x410 kernel/time/hrtimer.c:1259
 alarm_init kernel/time/alarmtimer.c:339 [inline]
 alarm_timer_nsleep+0x164/0x4d0 kernel/time/alarmtimer.c:787
 SYSC_clock_nanosleep kernel/time/posix-timers.c:1226 [inline]
 SyS_clock_nanosleep+0x235/0x330 kernel/time/posix-timers.c:1204
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43fc99
RSP: 002b:00007ffc5da49b88 EFLAGS: 00000207 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fc99
RDX: 000000002084fff0 RSI: 0000000000000000 RDI: 0000000000000009
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000020fd9000 R11: 0000000000000207 R12: 00000000004015c0
R13: 0000000000401650 R14: 0000000000000000 R15: 0000000000000000

======================================================
WARNING: possible circular locking dependency detected
4.16.0-rc6+ #1 Not tainted
------------------------------------------------------
syzkaller382398/4185 is trying to acquire lock:
 ((console_sem).lock){..-.}, at: [<000000006804a99b>] down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
 (&obj_hash[i].lock){-.-.}, at: [<000000004f13d83a>] __debug_object_init+0x109/0x1040 lib/debugobjects.c:343

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+0x109/0x1040 lib/debugobjects.c:343
       debug_object_init+0x17/0x20 lib/debugobjects.c:391
       debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
       debug_init kernel/time/hrtimer.c:458 [inline]
       hrtimer_init+0x8c/0x410 kernel/time/hrtimer.c:1259
       init_dl_task_timer+0x1b/0x50 kernel/sched/deadline.c:1060
       __sched_fork+0x2bb/0xb60 kernel/sched/core.c:2189
       init_idle+0x75/0x820 kernel/sched/core.c:5352
       sched_init+0xb19/0xc43 kernel/sched/core.c:6049
       start_kernel+0x452/0x819 init/main.c:586
       x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:378
       x86_64_start_kernel+0x77/0x7a arch/x86/kernel/head64.c:359
       secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:239

-> #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:1760 [inline]
       task_fork_fair+0x7a/0x690 kernel/sched/fair.c:9471
       sched_fork+0x450/0xc10 kernel/sched/core.c:2405
       copy_process.part.38+0x1758/0x4b60 kernel/fork.c:1763
       copy_process kernel/fork.c:1606 [inline]
       _do_fork+0x1f7/0xf70 kernel/fork.c:2087
       kernel_thread+0x34/0x40 kernel/fork.c:2146
       rest_init+0x22/0xf0 init/main.c:403
       start_kernel+0x7f1/0x819 init/main.c:717
       x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:378
       x86_64_start_kernel+0x77/0x7a arch/x86/kernel/head64.c:359
       secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:239

-> #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+0xbc/0x15f0 kernel/sched/core.c:1989
       wake_up_process+0x10/0x20 kernel/sched/core.c:2152
       __up.isra.0+0x1cc/0x2c0 kernel/locking/semaphore.c:262
       up+0x13b/0x1d0 kernel/locking/semaphore.c:187
       __up_console_sem+0xb2/0x1a0 kernel/printk/printk.c:242
       console_unlock+0x5af/0xfb0 kernel/printk/printk.c:2417
       do_con_write+0x106e/0x1f70 drivers/tty/vt/vt.c:2433
       con_write+0x25/0xb0 drivers/tty/vt/vt.c:2782
       process_output_block drivers/tty/n_tty.c:579 [inline]
       n_tty_write+0x5ef/0xec0 drivers/tty/n_tty.c:2308
       do_tty_write drivers/tty/tty_io.c:958 [inline]
       tty_write+0x3fa/0x840 drivers/tty/tty_io.c:1042
       __vfs_write+0xef/0x970 fs/read_write.c:480
       vfs_write+0x189/0x510 fs/read_write.c:544
       SYSC_write fs/read_write.c:589 [inline]
       SyS_write+0xef/0x220 fs/read_write.c:581
       do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #0 ((console_sem).lock){..-.}:
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920
       __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+0xa2/0x1e0 kernel/printk/printk.c:225
       console_trylock+0x15/0x70 kernel/printk/printk.c:2229
       console_trylock_spinning kernel/printk/printk.c:1643 [inline]
       vprintk_emit+0x5b5/0xb90 kernel/printk/printk.c:1906
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1947
       vprintk_func+0x57/0xc0 kernel/printk/printk_safe.c:379
       printk+0xaa/0xca kernel/printk/printk.c:1980
       debug_object_is_on_stack lib/debugobjects.c:325 [inline]
       __debug_object_init+0x5cc/0x1040 lib/debugobjects.c:354
       debug_object_init+0x17/0x20 lib/debugobjects.c:391
       debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
       debug_init kernel/time/hrtimer.c:458 [inline]
       hrtimer_init+0x8c/0x410 kernel/time/hrtimer.c:1259
       alarm_init kernel/time/alarmtimer.c:339 [inline]
       alarm_timer_nsleep+0x164/0x4d0 kernel/time/alarmtimer.c:787
       SYSC_clock_nanosleep kernel/time/posix-timers.c:1226 [inline]
       SyS_clock_nanosleep+0x235/0x330 kernel/time/posix-timers.c:1204
       do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

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 ***

1 lock held by syzkaller382398/4185:
 #0:  (&obj_hash[i].lock){-.-.}, at: [<000000004f13d83a>] __debug_object_init+0x109/0x1040 lib/debugobjects.c:343

stack backtrace:
CPU: 0 PID: 4185 Comm: syzkaller382398 Not tainted 4.16.0-rc6+ #1
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/0x24d lib/dump_stack.c:53
 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223
 check_prev_add kernel/locking/lockdep.c:1863 [inline]
 check_prevs_add kernel/locking/lockdep.c:1976 [inline]
 validate_chain kernel/locking/lockdep.c:2417 [inline]
 __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431
 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920
 __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+0xa2/0x1e0 kernel/printk/printk.c:225
 console_trylock+0x15/0x70 kernel/printk/printk.c:2229
 console_trylock_spinning kernel/printk/printk.c:1643 [inline]
 vprintk_emit+0x5b5/0xb90 kernel/printk/printk.c:1906
 vprintk_default+0x28/0x30 kernel/printk/printk.c:1947
 vprintk_func+0x57/0xc0 kernel/printk/printk_safe.c:379
 printk+0xaa/0xca kernel/printk/printk.c:1980
 debug_object_is_on_stack lib/debugobjects.c:325 [inline]
 __debug_object_init+0x5cc/0x1040 lib/debugobjects.c:354
 debug_object_init+0x17/0x20 lib/debugobjects.c:391
 debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
 debug_init kernel/time/hrtimer.c:458 [inline]
 hrtimer_init+0x8c/0x410 kernel/time/hrtimer.c:1259
 alarm_init kernel/time/alarmtimer.c:339 [inline]
 alarm_timer_nsleep+0x164/0x4d0 kernel/time/alarmtimer.c:787
 SYSC_clock_nanosleep kernel/time/posix-timers.c:1226 [inline]
 SyS_clock_nanosleep+0x235/0x330 kernel/time/posix-timers.c:1204
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43fc99
RSP: 002b:00007ffc5da49b88 EFLAGS: 00000207 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fc99
RDX: 000000002084fff0 RSI: 0000000000000000 RDI: 0000000000000009
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000020fd9000 R11: 0000000000000207 R12: 00000000004015c0
R13: 0000000000401650 R14: 0000000000000000 R15: 0000000000000000
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (192):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/25 14:09 upstream bcfc1f455466 e033c1f1 .config console log report syz C ci-upstream-kasan-gce-root
2018/03/25 12:59 upstream bcfc1f455466 e033c1f1 .config console log report syz C ci-upstream-kasan-gce-root
2018/04/05 08:44 upstream 3e968c9f1401 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/05 05:01 upstream 3e968c9f1401 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/05 01:59 upstream 3e968c9f1401 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/04 21:40 upstream 17dec0a94915 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/04 17:01 upstream 17dec0a94915 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/04 15:42 upstream 17dec0a94915 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/04 13:08 upstream 17dec0a94915 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/04 07:04 upstream f2d285669aae 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 20:24 upstream f2d285669aae 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 15:19 upstream 642e7fd23353 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 14:03 upstream 642e7fd23353 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 12:15 upstream 642e7fd23353 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 06:22 upstream 86bbbebac193 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 03:27 upstream 86bbbebac193 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/03 01:03 upstream 86bbbebac193 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/02 22:43 upstream 86bbbebac193 676bd07e .config console log report ci-upstream-kasan-gce-root
2018/04/02 18:01 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/02 14:25 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/02 11:49 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/02 07:50 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/02 05:47 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/02 02:08 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/01 23:01 upstream 0adb32858b0b dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/01 14:44 upstream 10b84daddbec 0a78e248 .config console log report ci-upstream-kasan-gce-root
2018/04/01 08:08 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/03/31 16:33 upstream b5dbc28762fd 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 14:33 upstream b5dbc28762fd 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 09:38 upstream b5dbc28762fd 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 06:56 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 03:33 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 02:09 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/30 20:01 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/30 15:17 upstream c2a9838452a4 d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/30 11:07 upstream c2a9838452a4 d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/30 07:42 upstream c2a9838452a4 d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/30 05:09 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/30 01:30 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/29 23:33 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/29 18:42 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/29 16:52 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/29 12:05 upstream 0b412605ef5f d47f0ed6 .config console log report ci-upstream-kasan-gce-root
2018/03/25 11:45 upstream bcfc1f455466 e033c1f1 .config console log report ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.