syzbot


WARNING: ODEBUG bug in snd_pcm_lib_free_vmalloc_buffer

Status: closed as invalid on 2018/04/11 18:39
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+2911a75fc9a6b162bc8d@syzkaller.appspotmail.com
First crash: 2735d, last: 2728d

Sample crash report:
------------[ cut here ]------------
ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x90 kernel/workqueue.c:1355
WARNING: CPU: 1 PID: 6286 at lib/debugobjects.c:291 debug_print_object+0x166/0x220 lib/debugobjects.c:288
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 6286 Comm: syz-executor2 Not tainted 4.16.0-rc3+ #340
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+0x211/0x2d0 lib/bug.c:184
 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_print_object+0x166/0x220 lib/debugobjects.c:288
RSP: 0018:ffff8801aad1ef88 EFLAGS: 00010086
RAX: dffffc0000000008 RBX: 0000000000000003 RCX: ffffffff815abb7e
RDX: 0000000000000000 RSI: 1ffff100355a3da1 RDI: 1ffff100355a3d76
RBP: ffff8801aad1efc8 R08: 0000000000000000 R09: 1ffff100355a3d48
R10: ffffed00355a3e20 R11: ffffffff86f39838 R12: 0000000000000001
R13: ffffffff86f4b0a0 R14: ffffffff86408340 R15: ffffffff815fe350
 __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
 debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
 __vunmap+0x112/0x380 mm/vmalloc.c:1530
 vfree+0x50/0xe0 mm/vmalloc.c:1606
 snd_pcm_lib_free_vmalloc_buffer+0x7a/0xe0 sound/core/pcm_memory.c:433
 loopback_hw_free+0x14e/0x1a0 sound/drivers/aloop.c:593
 snd_pcm_release_substream.part.44+0x13c/0x300 sound/core/pcm_native.c:2351
 snd_pcm_release_substream+0x59/0x70 sound/core/pcm_native.c:2362
 snd_pcm_oss_release_file.part.18+0x71/0xa0 sound/core/oss/pcm_oss.c:2266
 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2261 [inline]
 snd_pcm_oss_release+0x104/0x280 sound/core/oss/pcm_oss.c:2446
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73a/0x16d0 kernel/signal.c:2469
 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x453d69
RSP: 002b:00007f6b2f061c88 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f6b2f0626d4 RCX: 0000000000453d69
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 000000000072becc
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000356 R14: 00000000006f50b0 R15: 0000000000000000

======================================================
WARNING: possible circular locking dependency detected
4.16.0-rc3+ #340 Not tainted
------------------------------------------------------
syz-executor2/6286 is trying to acquire lock:
 ((console_sem).lock){..-.}, at: [<00000000522b592a>] down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
 (&obj_hash[i].lock){-.-.}, at: [<000000007ed7c150>] __debug_check_no_obj_freed lib/debugobjects.c:736 [inline]
 (&obj_hash[i].lock){-.-.}, at: [<000000007ed7c150>] debug_check_no_obj_freed+0x1e9/0xf1f lib/debugobjects.c:774

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
       vprintk_emit+0x5c3/0xb90 kernel/printk/printk.c:1907
       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
       kauditd_printk_skb kernel/audit.c:506 [inline]
       kauditd_hold_skb+0x163/0x180 kernel/audit.c:539
       kauditd_send_queue+0xfa/0x140 kernel/audit.c:702
       kauditd_thread+0x660/0x940 kernel/audit.c:828
       kthread+0x33c/0x400 kernel/kthread.c:238
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406

-> #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
       __warn_printk+0x90/0xf0 kernel/panic.c:599
       debug_print_object+0x166/0x220 lib/debugobjects.c:288
       __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
       debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
       __vunmap+0x112/0x380 mm/vmalloc.c:1530
       vfree+0x50/0xe0 mm/vmalloc.c:1606
       snd_pcm_lib_free_vmalloc_buffer+0x7a/0xe0 sound/core/pcm_memory.c:433
       loopback_hw_free+0x14e/0x1a0 sound/drivers/aloop.c:593
       snd_pcm_release_substream.part.44+0x13c/0x300 sound/core/pcm_native.c:2351
       snd_pcm_release_substream+0x59/0x70 sound/core/pcm_native.c:2362
       snd_pcm_oss_release_file.part.18+0x71/0xa0 sound/core/oss/pcm_oss.c:2266
       snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2261 [inline]
       snd_pcm_oss_release+0x104/0x280 sound/core/oss/pcm_oss.c:2446
       __fput+0x327/0x7e0 fs/file_table.c:209
       ____fput+0x15/0x20 fs/file_table.c:243
       task_work_run+0x199/0x270 kernel/task_work.c:113
       exit_task_work include/linux/task_work.h:22 [inline]
       do_exit+0x9bb/0x1ad0 kernel/exit.c:865
       do_group_exit+0x149/0x400 kernel/exit.c:968
       get_signal+0x73a/0x16d0 kernel/signal.c:2469
       do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
       exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
       prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
       syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
       do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
       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 ***

2 locks held by syz-executor2/6286:
 #0:  (&pcm->open_mutex){+.+.}, at: [<00000000eb9efeab>] snd_pcm_oss_release+0xf2/0x280 sound/core/oss/pcm_oss.c:2445
 #1:  (&obj_hash[i].lock){-.-.}, at: [<000000007ed7c150>] __debug_check_no_obj_freed lib/debugobjects.c:736 [inline]
 #1:  (&obj_hash[i].lock){-.-.}, at: [<000000007ed7c150>] debug_check_no_obj_freed+0x1e9/0xf1f lib/debugobjects.c:774

stack backtrace:
CPU: 1 PID: 6286 Comm: syz-executor2 Not tainted 4.16.0-rc3+ #340
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
 __warn_printk+0x90/0xf0 kernel/panic.c:599
 debug_print_object+0x166/0x220 lib/debugobjects.c:288
 __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
 debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
 __vunmap+0x112/0x380 mm/vmalloc.c:1530
 vfree+0x50/0xe0 mm/vmalloc.c:1606
 snd_pcm_lib_free_vmalloc_buffer+0x7a/0xe0 sound/core/pcm_memory.c:433
 loopback_hw_free+0x14e/0x1a0 sound/drivers/aloop.c:593
 snd_pcm_release_substream.part.44+0x13c/0x300 sound/core/pcm_native.c:2351
 snd_pcm_release_substream+0x59/0x70 sound/core/pcm_native.c:2362
 snd_pcm_oss_release_file.part.18+0x71/0xa0 sound/core/oss/pcm_oss.c:2266
 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2261 [inline]
 snd_pcm_oss_release+0x104/0x280 sound/core/oss/pcm_oss.c:2446
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73a/0x16d0 kernel/signal.c:2469
 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4
Lost 7 message(s)!
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/05 08:41 upstream e64b9562ba28 2c6f473e .config console log report ci-upstream-kasan-gce
2018/02/26 14:45 upstream 4a3928c6f8a5 9fe8aa42 .config console log report ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.