syzbot


WARNING: ODEBUG bug in free_task

Status: closed as dup on 2018/10/10 12:59
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+71aff6ea121ffefc280f@syzkaller.appspotmail.com
Fix commit: fe9bc1644918 RDMA/restrack: Protect from reentry to resource return path
First crash: 2236d, last: 2227d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
WARNING in __put_task_struct (2) kernel C 17 2227d 2235d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH 4.19 00/63] 4.19.76-stable review 83 (83) 2019/10/02 13:16
WARNING: ODEBUG bug in free_task 2 (3) 2018/10/11 18:05
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 WARNING: ODEBUG bug in free_task C done 165 1878d 1888d 1/1 fixed on 2019/12/11 14:03

Sample crash report:
------------[ cut here ]------------
ODEBUG: free active (active state 1) object type: rcu_head hint:           (null)
WARNING: CPU: 1 PID: 5590 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: 5590 Comm: syz-executor422 Not tainted 4.19.0-rc7-next-20181012+ #93
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+0x244/0x3ab lib/dump_stack.c:113
 panic+0x238/0x4e7 kernel/panic.c:184
 __warn.cold.8+0x163/0x1ba kernel/panic.c:536
 report_bug+0x254/0x2d0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
 do_invalid_op+0x36/0x40 arch/x86/kernel/traps.c:290
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:969
RIP: 0010:debug_print_object+0x16a/0x210 lib/debugobjects.c:326
Code: 41 88 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 92 00 00 00 48 8b 14 dd 20 07 41 88 4c 89 fe 48 c7 c7 c0 fc 40 88 e8 96 e0 b3 fd <0f> 0b 83 05 c9 dd 5e 06 01 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f
RSP: 0018:ffff8801ba9c6da8 EFLAGS: 00010086
RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8164bc15 RDI: 0000000000000005
RBP: ffff8801ba9c6de8 R08: ffff8801d80d6400 R09: ffffed003b5e3eda
R10: ffffed003b5e3eda R11: ffff8801daf1f6d7 R12: 0000000000000001
R13: ffffffff8939a4e0 R14: 0000000000000000 R15: ffffffff88410160
 __debug_check_no_obj_freed lib/debugobjects.c:786 [inline]
 debug_check_no_obj_freed+0x3ae/0x58d lib/debugobjects.c:818
 kmem_cache_free+0x202/0x290 mm/slab.c:3759
 free_task_struct kernel/fork.c:163 [inline]
 free_task+0x16e/0x1f0 kernel/fork.c:457
 __put_task_struct+0x2e6/0x620 kernel/fork.c:730
 put_task_struct include/linux/sched/task.h:96 [inline]
 finish_task_switch+0x66c/0x900 kernel/sched/core.c:2715
 context_switch kernel/sched/core.c:2834 [inline]
 __schedule+0x8d7/0x21d0 kernel/sched/core.c:3480
 schedule+0xfe/0x460 kernel/sched/core.c:3524
 freezable_schedule include/linux/freezer.h:172 [inline]
 futex_wait_queue_me+0x3f9/0x840 kernel/futex.c:2530
 futex_wait+0x45c/0xa50 kernel/futex.c:2645
 do_futex+0x31a/0x26d0 kernel/futex.c:3528
 __do_sys_futex kernel/futex.c:3589 [inline]
 __se_sys_futex kernel/futex.c:3557 [inline]
 __x64_sys_futex+0x472/0x6a0 kernel/futex.c:3557
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446479
Code: e8 2c b3 02 00 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 2b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f255acf5da8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00000000006dbc38 RCX: 0000000000446479
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000006dbc38
RBP: 00000000006dbc30 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc3c
R13: 2f646e6162696e69 R14: 666e692f7665642f R15: 00000000006dbd2c

======================================================
WARNING: possible circular locking dependency detected
4.19.0-rc7-next-20181012+ #93 Not tainted
------------------------------------------------------
syz-executor422/5590 is trying to acquire lock:
00000000c8dee467 ((console_sem).lock){-.-.}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
00000000406216a9 (&obj_hash[i].lock){-.-.}, at: __debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
00000000406216a9 (&obj_hash[i].lock){-.-.}, at: debug_check_no_obj_freed+0x17a/0x58d lib/debugobjects.c:818

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+0x99/0xd0 kernel/locking/spinlock.c:152
       __debug_object_init+0x127/0x1290 lib/debugobjects.c:384
       debug_object_init+0x16/0x20 lib/debugobjects.c:432
       debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
       debug_init kernel/time/hrtimer.c:458 [inline]
       hrtimer_init+0x97/0x490 kernel/time/hrtimer.c:1308
       init_dl_task_timer+0x1b/0x50 kernel/sched/deadline.c:1057
       __sched_fork+0x2ae/0x590 kernel/sched/core.c:2166
       init_idle+0x75/0x740 kernel/sched/core.c:5382
       sched_init+0xb33/0xc02 kernel/sched/core.c:6065
       start_kernel+0x4be/0xa2b init/main.c:607
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
       x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451
       secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #2 (&rq->lock){-.-.}:
       __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
       _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:144
       rq_lock kernel/sched/sched.h:1125 [inline]
       task_fork_fair+0xb0/0x6d0 kernel/sched/fair.c:9752
       sched_fork+0x443/0xba0 kernel/sched/core.c:2359
       copy_process+0x2585/0x8760 kernel/fork.c:1887
       _do_fork+0x1cb/0x11c0 kernel/fork.c:2216
       kernel_thread+0x34/0x40 kernel/fork.c:2275
       rest_init+0x28/0x372 init/main.c:408
       arch_call_rest_init+0xe/0x1b
       start_kernel+0x9f0/0xa2b init/main.c:744
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
       x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451
       secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #1 (&p->pi_lock){-.-.}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152
       try_to_wake_up+0xd2/0x12e0 kernel/sched/core.c:1965
       wake_up_process+0x10/0x20 kernel/sched/core.c:2129
       __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:243
       console_unlock+0x80c/0x1160 kernel/printk/printk.c:2426
       vprintk_emit+0x33d/0x930 kernel/printk/printk.c:1921
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1962
       vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
       printk+0xa7/0xcf kernel/printk/printk.c:1995
       check_stack_usage kernel/exit.c:755 [inline]
       do_exit.cold.18+0x5b/0x21f kernel/exit.c:916
       do_group_exit+0x177/0x440 kernel/exit.c:970
       __do_sys_exit_group kernel/exit.c:981 [inline]
       __se_sys_exit_group kernel/exit.c:979 [inline]
       __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:979
       do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 ((console_sem).lock){-.-.}:
       lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3840
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152
       down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
       __down_trylock_console_sem+0xae/0x1f0 kernel/printk/printk.c:226
       console_trylock+0x15/0xa0 kernel/printk/printk.c:2244
       console_trylock_spinning kernel/printk/printk.c:1648 [inline]
       vprintk_emit+0x322/0x930 kernel/printk/printk.c:1920
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1962
       vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
       printk+0xa7/0xcf kernel/printk/printk.c:1995
       __warn_printk+0x8c/0xe0 kernel/panic.c:590
       debug_print_object+0x16a/0x210 lib/debugobjects.c:326
       __debug_check_no_obj_freed lib/debugobjects.c:786 [inline]
       debug_check_no_obj_freed+0x3ae/0x58d lib/debugobjects.c:818
       kmem_cache_free+0x202/0x290 mm/slab.c:3759
       free_task_struct kernel/fork.c:163 [inline]
       free_task+0x16e/0x1f0 kernel/fork.c:457
       __put_task_struct+0x2e6/0x620 kernel/fork.c:730
       put_task_struct include/linux/sched/task.h:96 [inline]
       finish_task_switch+0x66c/0x900 kernel/sched/core.c:2715
       context_switch kernel/sched/core.c:2834 [inline]
       __schedule+0x8d7/0x21d0 kernel/sched/core.c:3480
       schedule+0xfe/0x460 kernel/sched/core.c:3524
       freezable_schedule include/linux/freezer.h:172 [inline]
       futex_wait_queue_me+0x3f9/0x840 kernel/futex.c:2530
       futex_wait+0x45c/0xa50 kernel/futex.c:2645
       do_futex+0x31a/0x26d0 kernel/futex.c:3528
       __do_sys_futex kernel/futex.c:3589 [inline]
       __se_sys_futex kernel/futex.c:3557 [inline]
       __x64_sys_futex+0x472/0x6a0 kernel/futex.c:3557
       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 ***

1 lock held by syz-executor422/5590:
 #0: 00000000406216a9 (&obj_hash[i].lock){-.-.}, at: __debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
 #0: 00000000406216a9 (&obj_hash[i].lock){-.-.}, at: debug_check_no_obj_freed+0x17a/0x58d lib/debugobjects.c:818

stack backtrace:
CPU: 1 PID: 5590 Comm: syz-executor422 Not tainted 4.19.0-rc7-next-20181012+ #93
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+0x244/0x3ab lib/dump_stack.c:113
 print_circular_bug.isra.35.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1221
 check_prev_add kernel/locking/lockdep.c:1861 [inline]
 check_prevs_add kernel/locking/lockdep.c:1974 [inline]
 validate_chain kernel/locking/lockdep.c:2345 [inline]
 __lock_acquire+0x3445/0x4da0 kernel/locking/lockdep.c:3337
 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3840
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152
 down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
 __down_trylock_console_sem+0xae/0x1f0 kernel/printk/printk.c:226
 console_trylock+0x15/0xa0 kernel/printk/printk.c:2244
 console_trylock_spinning kernel/printk/printk.c:1648 [inline]
 vprintk_emit+0x322/0x930 kernel/printk/printk.c:1920
 vprintk_default+0x28/0x30 kernel/printk/printk.c:1962
 vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
 printk+0xa7/0xcf kernel/printk/printk.c:1995
 __warn_printk+0x8c/0xe0 kernel/panic.c:590
 debug_print_object+0x16a/0x210 lib/debugobjects.c:326
 __debug_check_no_obj_freed lib/debugobjects.c:786 [inline]
 debug_check_no_obj_freed+0x3ae/0x58d lib/debugobjects.c:818
 kmem_cache_free+0x202/0x290 mm/slab.c:3759
 free_task_struct kernel/fork.c:163 [inline]
 free_task+0x16e/0x1f0 kernel/fork.c:457
 __put_task_struct+0x2e6/0x620 kernel/fork.c:730
 put_task_struct include/linux/sched/task.h:96 [inline]
 finish_task_switch+0x66c/0x900 kernel/sched/core.c:2715
 context_switch kernel/sched/core.c:2834 [inline]
 __schedule+0x8d7/0x21d0 kernel/sched/core.c:3480
 schedule+0xfe/0x460 kernel/sched/core.c:3524
 freezable_schedule include/linux/freezer.h:172 [inline]
 futex_wait_queue_me+0x3f9/0x840 kernel/futex.c:2530
 futex_wait+0x45c/0xa50 kernel/futex.c:2645
 do_futex+0x31a/0x26d0 kernel/futex.c:3528
 __do_sys_futex kernel/futex.c:3589 [inline]
 __se_sys_futex kernel/futex.c:3557 [inline]
 __x64_sys_futex+0x472/0x6a0 kernel/futex.c:3557
 ? __ia32_s
Lost 21 message(s)!
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (423):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/10/15 00:20 linux-next 774ea0551a29 caf12900 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/13 18:34 linux-next 774ea0551a29 caf12900 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/12 07:54 linux-next 771b65e89c8a ba6ddb43 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/10 12:11 linux-next 7f3049305d22 5b11ac2c .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/09 05:35 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/09 03:35 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/08 16:45 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/08 13:48 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/08 13:02 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/08 11:33 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/08 11:33 linux-next ae16eea39a86 8b311eaf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/10/17 06:08 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/17 05:08 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/17 03:31 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/17 02:08 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/17 00:15 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 21:45 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 20:40 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 18:03 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 14:08 linux-next 6d5d82417dd6 1ba7fd7e .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 11:19 linux-next 6d5d82417dd6 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 09:28 linux-next 6d5d82417dd6 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 07:43 linux-next 6d5d82417dd6 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 05:48 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 03:51 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 01:54 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/16 00:54 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 23:49 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 22:32 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 18:11 linux-next ca0591d03a2d 8cd30605 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 16:42 linux-next ca0591d03a2d caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 14:53 linux-next ca0591d03a2d caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 12:22 linux-next ca0591d03a2d caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 11:21 linux-next ca0591d03a2d caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 09:31 linux-next ca0591d03a2d caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 07:47 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 05:28 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 04:16 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 02:59 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 01:54 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/15 00:17 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 23:02 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 22:32 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 21:09 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 20:06 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 18:43 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 17:27 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 15:36 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 14:32 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 12:33 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 11:28 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 09:59 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 08:59 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/08 10:38 linux-next ae16eea39a86 8b311eaf .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.