syzbot


general protection fault in __hrtimer_run_queues (2)

Status: auto-closed as invalid on 2019/07/02 11:21
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+73879d0d51aa874f8e09@syzkaller.appspotmail.com
First crash: 1939d, last: 1939d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in __hrtimer_run_queues kernel C 1 2119d 2119d 0/26 closed as invalid on 2018/07/07 21:38
upstream general protection fault in __hrtimer_run_queues (3) reiserfs C error done 2 137d 302d 26/26 fixed on 2024/01/30 15:47

Sample crash report:
protocol 88fb is buggy, dev hsr_slave_1
kasan: CONFIG_KASAN_INLINE enabled
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 336860332 Comm:  Not tainted 4.20.0+ #7
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:lookup_object lib/debugobjects.c:156 [inline]
RIP: 0010:debug_object_deactivate lib/debugobjects.c:542 [inline]
RIP: 0010:debug_object_deactivate+0x16c/0x4b0 lib/debugobjects.c:529
Code: c1 ea 03 42 80 3c 2a 00 0f 85 49 02 00 00 4d 8b 24 24 4d 85 e4 0f 84 d1 00 00 00 49 8d 7c 24 18 83 c3 01 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 fa 01 00 00 49 3b 4c 24 18 75 c0 49 8d 7c 24
RSP: 0018:ffff8880ae607b80 EFLAGS: 00010006
RAX: 1ffffffff16dc56c RBX: 0000000000000005 RCX: ffff8880ae626620
RDX: 03e1f86baba82b8b RSI: 0000000000000004 RDI: 1f0fc35d5d415c59
RBP: ffff8880ae607c70 R08: 1ffff11015cc0f5c R09: ffffffff899ad160
R10: 0000000000000086 R11: 0000000000000003 R12: 1f0fc35d5d415c41
R13: dffffc0000000000 R14: 1ffff11015cc0f74 R15: ffffffff8b6e2b68
FS:  0000000000000000(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000709071 CR3: 00000000a6016000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 debug_hrtimer_deactivate kernel/time/hrtimer.c:412 [inline]
 debug_deactivate kernel/time/hrtimer.c:462 [inline]
 __run_hrtimer kernel/time/hrtimer.c:1359 [inline]
 __hrtimer_run_queues+0x225/0x1050 kernel/time/hrtimer.c:1451
 hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1509
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1035 [inline]
 smp_apic_timer_interrupt+0x18d/0x760 arch/x86/kernel/apic/apic.c:1060
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
 </IRQ>
Modules linked in:

======================================================
WARNING: possible circular locking dependency detected
4.20.0+ #7 Not tainted
------------------------------------------------------
kworker/u4:5/9341 is trying to acquire lock:
000000002fe6ff90 ((console_sem).lock){-.-.}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
000000000ac2097c (&obj_hash[i].lock){-.-.}, at: debug_object_deactivate lib/debugobjects.c:540 [inline]
000000000ac2097c (&obj_hash[i].lock){-.-.}, at: debug_object_deactivate+0x101/0x4b0 lib/debugobjects.c:529

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+0x95/0xcd kernel/locking/spinlock.c:152
       __debug_object_init+0xf6/0x12d0 lib/debugobjects.c:383
       debug_object_init+0x16/0x20 lib/debugobjects.c:431
       debug_hrtimer_init kernel/time/hrtimer.c:401 [inline]
       debug_init kernel/time/hrtimer.c:449 [inline]
       hrtimer_init+0x97/0x480 kernel/time/hrtimer.c:1299
       init_dl_task_timer+0x1b/0x50 kernel/sched/deadline.c:1057
       __sched_fork+0x2bf/0x5b0 kernel/sched/core.c:2166
       init_idle+0x75/0x670 kernel/sched/core.c:5374
       sched_init+0xb10/0xbe8 kernel/sched/core.c:6063
       start_kernel+0x445/0x8bd init/main.c:609
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
       x86_64_start_kernel+0x77/0x7b 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+0x2f/0x40 kernel/locking/spinlock.c:144
       rq_lock kernel/sched/sched.h:1149 [inline]
       task_fork_fair+0xb5/0x7a0 kernel/sched/fair.c:10058
       sched_fork+0x437/0xb90 kernel/sched/core.c:2359
       copy_process+0x1ff6/0x8730 kernel/fork.c:1893
       _do_fork+0x1a9/0x1170 kernel/fork.c:2222
       kernel_thread+0x34/0x40 kernel/fork.c:2281
       rest_init+0x28/0x37b init/main.c:409
       arch_call_rest_init+0xe/0x1b
       start_kernel+0x882/0x8bd init/main.c:741
       x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
       x86_64_start_kernel+0x77/0x7b 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+0x95/0xcd kernel/locking/spinlock.c:152
       try_to_wake_up+0xb9/0x1480 kernel/sched/core.c:1965
       wake_up_process+0x10/0x20 kernel/sched/core.c:2129
       __up.isra.0+0x1c0/0x2a0 kernel/locking/semaphore.c:262
       up+0x13e/0x1c0 kernel/locking/semaphore.c:187
       __up_console_sem+0xb7/0x1c0 kernel/printk/printk.c:236
       console_unlock+0x778/0x11e0 kernel/printk/printk.c:2426
       vprintk_emit+0x370/0x960 kernel/printk/printk.c:1931
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
       vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
       printk+0xba/0xed kernel/printk/printk.c:1991
       kobject_uevent_env+0x96/0x102b lib/kobject_uevent.c:469
       call_crda net/wireless/reg.c:556 [inline]
       reg_query_database+0x27b/0x400 net/wireless/reg.c:1104
       reg_process_hint_core net/wireless/reg.c:2339 [inline]
       reg_process_hint+0x1b3/0xf50 net/wireless/reg.c:2677
       reg_process_pending_hints net/wireless/reg.c:2767 [inline]
       reg_todo+0x468/0xc00 net/wireless/reg.c:2844
       process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
       worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
       kthread+0x357/0x430 kernel/kthread.c:246
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

-> #0 ((console_sem).lock){-.-.}:
       lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
       down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
       __down_trylock_console_sem+0xa8/0x210 kernel/printk/printk.c:219
       console_trylock+0x15/0xa0 kernel/printk/printk.c:2242
       console_trylock_spinning kernel/printk/printk.c:1662 [inline]
       vprintk_emit+0x351/0x960 kernel/printk/printk.c:1930
       vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
       vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
       printk+0xba/0xed kernel/printk/printk.c:1991
       kasan_die_handler arch/x86/mm/kasan_init_64.c:252 [inline]
       kasan_die_handler.cold+0x11/0x23 arch/x86/mm/kasan_init_64.c:247
       notifier_call_chain+0x179/0x380 kernel/notifier.c:93
       __atomic_notifier_call_chain kernel/notifier.c:183 [inline]
       atomic_notifier_call_chain+0x96/0x190 kernel/notifier.c:193
       notify_die+0x1b2/0x270 kernel/notifier.c:549
       do_general_protection+0x13d/0x300 arch/x86/kernel/traps.c:557
       general_protection+0x1e/0x30 arch/x86/entry/entry_64.S:1142
       lookup_object lib/debugobjects.c:156 [inline]
       debug_object_deactivate lib/debugobjects.c:542 [inline]
       debug_object_deactivate+0x16c/0x4b0 lib/debugobjects.c:529
       debug_hrtimer_deactivate kernel/time/hrtimer.c:412 [inline]
       debug_deactivate kernel/time/hrtimer.c:462 [inline]
       __run_hrtimer kernel/time/hrtimer.c:1359 [inline]
       __hrtimer_run_queues+0x225/0x1050 kernel/time/hrtimer.c:1451
       hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1509
       local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1035 [inline]
       smp_apic_timer_interrupt+0x18d/0x760 arch/x86/kernel/apic/apic.c:1060
       apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
       rcu_lock_release include/linux/rcupdate.h:228 [inline]
       rcu_read_unlock include/linux/rcupdate.h:661 [inline]
       batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:423 [inline]
       batadv_nc_worker+0x313/0x920 net/batman-adv/network-coding.c:730
       process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
       worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
       kthread+0x357/0x430 kernel/kthread.c:246
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

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

6 locks held by kworker/u4:5/9341:
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: __write_once_size include/linux/compiler.h:218 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: atomic64_set include/asm-generic/atomic-instrumented.h:40 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: atomic_long_set include/asm-generic/atomic-long.h:59 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: set_work_data kernel/workqueue.c:617 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline]
 #0: 0000000076f7a36f ((wq_completion)"%s""bat_events"){+.+.}, at: process_one_work+0xbc7/0x1ce0 kernel/workqueue.c:2124
 #1: 000000007cba1831 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}, at: process_one_work+0xc1d/0x1ce0 kernel/workqueue.c:2128
 #2: 00000000a8b0ffcf (rcu_read_lock){....}, at: batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:417 [inline]
 #2: 00000000a8b0ffcf (rcu_read_lock){....}, at: batadv_nc_worker+0x167/0x920 net/batman-adv/network-coding.c:730
 #3: 00000000bcc69ffb (hrtimer_bases.lock){-.-.}, at: hrtimer_interrupt+0xff/0x770 kernel/time/hrtimer.c:1490
 #4: 000000000ac2097c (&obj_hash[i].lock){-.-.}, at: debug_object_deactivate lib/debugobjects.c:540 [inline]
 #4: 000000000ac2097c (&obj_hash[i].lock){-.-.}, at: debug_object_deactivate+0x101/0x4b0 lib/debugobjects.c:529
 #5: 00000000a8b0ffcf (rcu_read_lock){....}, at: atomic_notifier_call_chain+0x0/0x190 kernel/notifier.c:329

stack backtrace:
CPU: 1 PID: 9341 Comm: kworker/u4:5 Not tainted 4.20.0+ #7
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1db/0x2d0 lib/dump_stack.c:113
 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1224
 check_prev_add kernel/locking/lockdep.c:1866 [inline]
 check_prevs_add kernel/locking/lockdep.c:1979 [inline]
 validate_chain kernel/locking/lockdep.c:2350 [inline]
 __lock_acquire+0x3014/0x4a30 kernel/locking/lockdep.c:3338
 lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
 down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
 __down_trylock_console_sem+0xa8/0x210 kernel/printk/printk.c:219
 console_trylock+0x15/0xa0 kernel/printk/printk.c:2242
 console_trylock_spinning kernel/printk/printk.c:1662 [inline]
 vprintk_emit+0x351/0x960 kernel/printk/printk.c:1930
 vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
 vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
 printk+0xba/0xed kernel/printk/printk.c:1991
 kasan_die_handler arch/x86/mm/kasan_init_64.c:252 [inline]
 kasan_die_handler.cold+0x11/0x23 arch/x86/mm/kasan_init_64.c:247
 notifier_call_chain+0x179/0x380 kernel/notifier.c:93
 __atomic_notifier_call_chain kernel/notifier.c:183 [inline]
 atomic_notifier_call_chain+0x96/0x190 kernel/notifier.c:193
 notify_die+0x1b2/0x270 kernel/notifier.c:549
 do_general_protection+0x13d/0x300 arch/x86/kernel/traps.c:557
 general_protection+0x1e/0x30 arch/x86/entry/entry_64.S:1142
RIP: 0010:lookup_object lib/debugobjects.c:156 [inline]
RIP: 0010:debug_object_deactivate lib/debugobjects.c:542 [inline]
RIP: 0010:debug_object_deactivate+0x16c/0x4b0 lib/debugobjects.c:529
Code: c1 ea 03 42 80 3c 2a 00 0f 85 49 02 00 00 4d 8b 24 24 4d 85 e4 0f 84 d1 00 00 00 49 8d 7c 24 18 83 c3 01 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 fa 01 00 00 49 3b 4c 24 18 75 c0 49 8d 7c 24
RSP: 0018:ffff8880ae707b80 EFLAGS: 00010006
RAX: 1ffffffff16d79ac RBX: 0000000000000003 RCX: ffff88808ad3fd10
RDX: 03e1f86baba82b8b RSI: 0000000000000004 RDI: 1f0fc35d5d415c59
RBP: ffff8880ae707c70 R08: 1ffff11015ce0f5c R09: ffffffff899ad160
R10: 0000000000000086 R11: 0000000000000003 R12: 1f0fc35d5d415c41
R13: dffffc0000000000 R14: 1ffff11015ce0f74 R15: ffffffff8b6bcd68
 debug_hrtimer_deactivate kernel/time/hrtimer.c:412 [inline]
 debug_deactivate kernel/time/hrtimer.c:462 [inline]
 __run_hrtimer kernel/time/hrtimer.c:1359 [inline]
 __hrtimer_run_queues+0x225/0x1050 kernel/time/hrtimer.c:1451
 hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1509
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1035 [inline]
 smp_apic_timer_interrupt+0x18d/0x760 arch/x86/kernel/apic/apic.c:1060
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
 </IRQ>
RIP: 0010:rcu_lock_release include/linux/rcupdate.h:228 [inline]
RIP: 0010:rcu_read_unlock include/linux/rcupdate.h:661 [inline]
RIP: 0010:batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:423 [inline]
RIP: 0010:batadv_nc_worker+0x313/0x920 net/batman-adv/network-coding.c:730
Code: e1 43 85 02 31 ff 44 89 e6 e8 39 20 af f9 45 84 e4 0f 84 ec 02 00 00 e8 eb 1e af f9 41 83 c6 01 e8 52 8b 99 f9 e8 dd 1e af f9 <48> c7 c2 80 77 d2 87 be 01 00 00 00 48 c7 c7 c0 f9 99 89 e8 d5 5f
RSP: 0018:ffff88809614f8b8 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13
RAX: ffff88809722c040 RBX: ffff88808d067780 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff87d27793 RDI: 1ffff11012c29f08
RBP: ffff88809614f9e0 R08: ffff88809722c040 R09: ffffed1015ce5b90
R10: ffffed1015ce5b8f R11: ffff8880ae72dc7b R12: 0000000000000001
R13: 000
Lost 39 message(s)!
---[ end trace 07ce5dfe86084493 ]---
general protection fault: 0000 [#2] PREEMPT SMP KASAN
CPU: 1 PID: 9341 Comm: kworker/u4:5 Tainted: G      D           4.20.0+ #7
RIP: 0010:lookup_object lib/debugobjects.c:156 [inline]
RIP: 0010:debug_object_deactivate lib/debugobjects.c:542 [inline]
RIP: 0010:debug_object_deactivate+0x16c/0x4b0 lib/debugobjects.c:529
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Code: c1 ea 03 42 80 3c 2a 00 0f 85 49 02 00 00 4d 8b 24 24 4d 85 e4 0f 84 d1 00 00 00 49 8d 7c 24 18 83 c3 01 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 fa 01 00 00 49 3b 4c 24 18 75 c0 49 8d 7c 24
Workqueue: bat_events batadv_nc_worker
RSP: 0018:ffff8880ae607b80 EFLAGS: 00010006
RIP: 0010:lookup_object lib/debugobjects.c:156 [inline]
RIP: 0010:debug_object_deactivate lib/debugobjects.c:542 [inline]
RIP: 0010:debug_object_deactivate+0x16c/0x4b0 lib/debugobjects.c:529
RAX: 1ffffffff16dc56c RBX: 0000000000000005 RCX: ffff8880ae626620
Code: c1 ea 03 42 80 3c 2a 00 0f 85 49 02 00 00 4d 8b 24 24 4d 85 e4 0f 84 d1 00 00 00 49 8d 7c 24 18 83 c3 01 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 fa 01 00 00 49 3b 4c 24 18 75 c0 49 8d 7c 24
RDX: 03e1f86baba82b8b RSI: 0000000000000004 RDI: 1f0fc35d5d415c59
RSP: 0018:ffff8880ae707b80 EFLAGS: 00010006
RBP: ffff8880ae607c70 R08: 1ffff11015cc0f5c R09: ffffffff899ad160
RAX: 1ffffffff16d79ac RBX: 0000000000000003 RCX: ffff88808ad3fd10
R10: 0000000000000086 R11: 0000000000000003 R12: 1f0fc35d5d415c41
RDX: 03e1f86baba82b8b RSI: 0000000000000004 RDI: 1f0fc35d5d415c59
R13: dffffc0000000000 R14: 1ffff11015cc0f74 R15: ffffffff8b6e2b68
RBP: ffff8880ae707c70 R08: 1ffff11015ce0f5c R09: ffffffff899ad160
FS:  0000000000000000(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
R10: 0000000000000086 R11: 0000000000000003 R12: 1f0fc35d5d415c41
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
R13: dffffc0000000000 R14: 1ffff11015ce0f74 R15: ffffffff8b6bcd68
CR2: 0000000000709071 CR3: 00000000a6016000 CR4: 00000000001406f0
FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/01/03 11:20 upstream 645ff1e8e704 66fcd29b .config console log report ci-upstream-kasan-gce-smack-root
* Struck through repros no longer work on HEAD.