syzbot


general protection fault in rb_next (2)

Status: closed as dup on 2018/12/31 07:15
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+563bb80fa8765090bf16@syzkaller.appspotmail.com
First crash: 1982d, last: 1936d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
kernel panic: corrupted stack end in wb_workfn mm C done 14 1943d 1944d
Discussions (1)
Title Replies (including bot) Last reply
general protection fault in rb_next (2) 1 (2) 2018/12/31 07:15
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in rb_next (3) kernel syz done done 1 1777d 1775d 12/26 fixed on 2019/08/27 17:15
upstream general protection fault in rb_next kernel 1 2110d 2110d 8/26 fixed on 2018/08/07 13:43

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
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: 1 PID: 64 Comm: ksoftirq³œ1 Not tainted 4.20.0+ #13
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:rb_next+0xd7/0x140 lib/rbtree.c:541
Code: 49 89 dc 4c 89 eb 48 83 e3 fc 48 89 d8 75 c8 48 83 c4 08 5b 41 5c 41 5d 41 5e 5d c3 48 89 d0 48 8d 78 10 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 75 1a 48 8b 50 10 48 85 d2 75 e3 48 83 c4 08 5b 41 5c
RSP: 0018:ffff8880ae707bd8 EFLAGS: 00010002
RAX: 0000000041b58ab3 RBX: dffffc0000000000 RCX: ffffffff87ee38f0
RDX: 000000000836b158 RSI: 0000000000000008 RDI: 0000000041b58ac3
RBP: ffff8880ae707c00 R08: ffff8880a94ba440 R09: fffffbfff16d60be
R10: fffffbfff16d60bd R11: ffffffff8b6b05eb R12: ffff8880ae726620
R13: ffff8880ae7268c1 R14: dffffc0000000000 R15: ffff8880ae725d40
FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000068 CR3: 0000000092a61000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 timerqueue_del+0xd8/0x150 lib/timerqueue.c:83
 __remove_hrtimer+0xa8/0x1c0 kernel/time/hrtimer.c:975
 __run_hrtimer kernel/time/hrtimer.c:1371 [inline]
 __hrtimer_run_queues+0x311/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+ #13 Not tainted
------------------------------------------------------
modprobe/18936 is trying to acquire lock:
00000000474bda00 ((console_sem).lock){-.-.}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136

but task is already holding lock:
000000003f9907be (&obj_hash[i].lock){-.-.}, at: __debug_check_no_obj_freed lib/debugobjects.c:776 [inline]
000000003f9907be (&obj_hash[i].lock){-.-.}, at: debug_check_no_obj_freed+0x170/0x588 lib/debugobjects.c:817

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:608
       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:1888
       _do_fork+0x1a9/0x1170 kernel/fork.c:2217
       kernel_thread+0x34/0x40 kernel/fork.c:2276
       rest_init+0x28/0x37b init/main.c:408
       arch_call_rest_init+0xe/0x1b
       start_kernel+0x882/0x8bd init/main.c:740
       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
       check_stack_usage kernel/exit.c:755 [inline]
       do_exit.cold+0x57/0x16a kernel/exit.c:916
       do_group_exit+0x177/0x430 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+0x44/0x50 kernel/exit.c:979
       do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #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
       __debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
       debug_check_no_obj_freed+0x1a6/0x588 lib/debugobjects.c:817
       kmem_cache_free+0x192/0x260 mm/slab.c:3746
       putname+0xef/0x130 fs/namei.c:261
       filename_lookup+0x359/0x530 fs/namei.c:2357
       user_path_at_empty+0x43/0x50 fs/namei.c:2608
       user_path_at include/linux/namei.h:57 [inline]
       do_faccessat+0x26e/0x860 fs/open.c:378
       __do_sys_access fs/open.c:430 [inline]
       __se_sys_access fs/open.c:428 [inline]
       __x64_sys_access+0x59/0x80 fs/open.c:428
       do_syscall_64+0x1a3/0x800 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 modprobe/18936:
 #0: 000000003f9907be (&obj_hash[i].lock){-.-.}, at: __debug_check_no_obj_freed lib/debugobjects.c:776 [inline]
 #0: 000000003f9907be (&obj_hash[i].lock){-.-.}, at: debug_check_no_obj_freed+0x170/0x588 lib/debugobjects.c:817
 #1: 00000000bd38cd39 (rcu_read_lock){....}, at: atomic_notifier_call_chain+0x0/0x190 kernel/notifier.c:329

stack backtrace:
CPU: 0 PID: 18936 Comm: modprobe Not tainted 4.20.0+ #13
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+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:__debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
RIP: 0010:debug_check_no_obj_freed+0x1a6/0x588 lib/debugobjects.c:817
Code: ff ff 80 38 00 0f 85 96 03 00 00 48 8b 85 50 ff ff ff 4c 8b 20 4d 85 e4 0f 84 8b 02 00 00 31 c9 41 89 cd 4c 89 e0 48 c1 e8 03 <42> 80 3c 38 00 0f 85 9d 02 00 00 49 8d 7c 24 18 41 83 c5 01 49 8b
RSP: 0018:ffff88808c2b7a48 EFLAGS: 00010802
RAX: 18777c6fdaebbb40 RBX: c3bbe37ed75dda00 RCX: 0000000000000000
RDX: 1ffffffff16cdf67 RSI: 0000000000000004 RDI: ffff8880a8ed3478
RBP: ffff88808c2b7b30 R08: 1ffff11011856f35 R09: ffffed1011856f36
R10: ffffed1011856f35 R11: 0000000000000003 R12: c3bbe37ed75dda00
R13: 0000000000000001 R14: ffffffff8b66fb28 R15: dffffc0000000000
 kmem_cache_free+0x192/0x260 mm/slab.c:3746
 putname+0xef/0x130 fs/namei.c:261
 filename_lookup+0x359/0x530 fs/namei.c:2357
 user_path_at_empty+0x43/0x50 fs/namei.c:2608
 user_path_at include/linux/namei.h:57 [inline]
 do_faccessat+0x26e/0x860 fs/open.c:378
 __do_sys_access fs/open.c:430 [inline]
 __se_sys_access fs/open.c:428 [inline]
 __x64_sys_access+0x59/0x80 fs/open.c:428
 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f7faf18b267
Code: 73 01 c3 48 8d 0d 3d af 20 00 31 d2 48 29 c2 89 11 48 83 c8 ff eb eb 90 90 90 90 90 90 90 90 90 90 90 90 b8 15 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8d 0d 0d af 20 00 31 d2 48 29 c2 89
RSP: 002b:00007ffe1c62df98 EFLAGS: 00000246 ORIG_RAX: 0000000000000015
RAX: ffffffffffffffda RBX: 00007f7faf3961c8 RCX: 00007f7faf18b267
RDX: 00007f7faf175158 RSI: 0000000000000004 RDI: 00007f7faf191e30
RBP: 00007ffe1c62e0f0 R08: 00007f7faf396770 R09: 0000000000000050
R10: ffffffffffffffb0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe1c7452f4 R14: 00007f7faf396bc8 R15: 0000000000000000
---[ end trace 8eb95c440de05a46 ]---
general protection fault: 0000 [#2] PREEMPT SMP KASAN
CPU: 0 PID: 18936 Comm: modprobe Tainted: G      D           4.20.0+ #13
RIP: 0010:rb_next+0xd7/0x140 lib/rbtree.c:541
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Code: 49 89 dc 4c 89 eb 48 83 e3 fc 48 89 d8 75 c8 48 83 c4 08 5b 41 5c 41 5d 41 5e 5d c3 48 89 d0 48 8d 78 10 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 75 1a 48 8b 50 10 48 85 d2 75 e3 48 83 c4 08 5b 41 5c
RIP: 0010:__debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
RIP: 0010:debug_check_no_obj_freed+0x1a6/0x588 lib/debugobjects.c:817
RSP: 0018:ffff8880ae707bd8 EFLAGS: 00010002
Code: ff ff 80 38 00 0f 85 96 03 00 00 48 8b 85 50 ff ff ff 4c 8b 20 4d 85 e4 0f 84 8b 02 00 00 31 c9 41 89 cd 4c 89 e0 48 c1 e8 03 <42> 80 3c 38 00 0f 85 9d 02 00 00 49 8d 7c 24 18 41 83 c5 01 49 8b
RAX: 0000000041b58ab3 RBX: dffffc0000000000 RCX: ffffffff87ee38f0
RSP: 0018:ffff88808c2b7a48 EFLAGS: 00010802
RDX: 000000000836b158 RSI: 0000000000000008 RDI: 0000000041b58ac3
RBP: ffff8880ae707c00 R08: ffff8880a94ba440 R09: fffffbfff16d60be
RAX: 18777c6fdaebbb40 RBX: c3bbe37ed75dda00 RCX: 0000000000000000
R10: fffffbfff16d60bd R11: ffffffff8b6b05eb R12: ffff8880ae726620
RDX: 1ffffffff16cdf67 RSI: 0000000000000004 RDI: ffff8880a8ed3478
R13: ffff8880ae7268c1 R14: dffffc0000000000 R15: ffff8880ae725d40
RBP: ffff88808c2b7b30 R08: 1ffff11011856f35 R09: ffffed1011856f36
FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
R10: ffffed1011856f35 R11: 0000000000000003 R12: c3bbe37ed75dda00
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
R13: 0000000000000001 R14: ffffffff8b66fb28 R15: dffffc0000000000
CR2: 0000000000000068 CR3: 0000000092a61000 CR4: 00000000001426e0
FS:  0000000000000000(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
CR2: 00007f7faf191e30 CR3: 0000000054b4d000 CR4: 00000000001426f0

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/01/07 08:45 upstream 574823bfab82 ee332608 .config console log report ci-upstream-kasan-gce-smack-root
2018/11/23 04:36 upstream edeca3a769ad 87815d9d .config console log report ci-upstream-kasan-gce-selinux-root
* Struck through repros no longer work on HEAD.