syzbot


WARNING: locking bug in sched_tick

Status: upstream: reported on 2024/07/11 21:22
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+6212b93592985c1211e8@syzkaller.appspotmail.com
First crash: 136d, last: 2d15h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] WARNING: locking bug in sched_tick 0 (1) 2024/07/11 21:22

Sample crash report:
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(1)
WARNING: CPU: 1 PID: 8594 at kernel/locking/lockdep.c:232 hlock_class kernel/locking/lockdep.c:232 [inline]
WARNING: CPU: 1 PID: 8594 at kernel/locking/lockdep.c:232 check_wait_context kernel/locking/lockdep.c:4826 [inline]
WARNING: CPU: 1 PID: 8594 at kernel/locking/lockdep.c:232 __lock_acquire+0x58c/0x2050 kernel/locking/lockdep.c:5152
Modules linked in:
CPU: 1 UID: 0 PID: 8594 Comm: syz.0.534 Not tainted 6.12.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024
RIP: 0010:hlock_class kernel/locking/lockdep.c:232 [inline]
RIP: 0010:check_wait_context kernel/locking/lockdep.c:4826 [inline]
RIP: 0010:__lock_acquire+0x58c/0x2050 kernel/locking/lockdep.c:5152
Code: 00 00 83 3d f5 dc ac 0e 00 75 23 90 48 c7 c7 40 c9 0a 8c 48 c7 c6 e0 cb 0a 8c e8 0f 7d e5 ff 48 ba 00 00 00 00 00 fc ff df 90 <0f> 0b 90 90 90 31 db 48 81 c3 c4 00 00 00 48 89 d8 48 c1 e8 03 0f
RSP: 0018:ffffc90000a189d0 EFLAGS: 00010046
RAX: babb500851197300 RBX: 0000000000000d68 RCX: ffff88802d4e3c00
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000005 R08: ffffffff8155e312 R09: 1ffff110170e519a
R10: dffffc0000000000 R11: ffffed10170e519b R12: ffff88802d4e3c00
R13: 0000000000000d68 R14: 1ffff11005a9c8e5 R15: ffff88802d4e4728
FS:  00007fed269f66c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b3090aff8 CR3: 00000000660ba000 CR4: 0000000000350ef0
Call Trace:
 <IRQ>
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
 raw_spin_rq_lock_nested+0xb0/0x140 kernel/sched/core.c:606
 raw_spin_rq_lock kernel/sched/sched.h:1506 [inline]
 rq_lock kernel/sched/sched.h:1805 [inline]
 sched_tick+0x72/0x610 kernel/sched/core.c:5598
 update_process_times+0x202/0x230 kernel/time/timer.c:2524
 tick_sched_handle kernel/time/tick-sched.c:276 [inline]
 tick_nohz_handler+0x37c/0x500 kernel/time/tick-sched.c:297
 __run_hrtimer kernel/time/hrtimer.c:1691 [inline]
 __hrtimer_run_queues+0x553/0xd50 kernel/time/hrtimer.c:1755
 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1817
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
 __sysvec_apic_timer_interrupt+0x112/0x420 arch/x86/kernel/apic/apic.c:1055
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1049
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194
Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 0e 32 2d f6 f6 44 24 21 02 75 52 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> f3 a9 91 f5 65 8b 05 b4 41 32 74 85 c0 74 43 48 c7 04 24 0e 36
RSP: 0018:ffffc90004827540 EFLAGS: 00000206
RAX: babb500851197300 RBX: 1ffff92000904eac RCX: ffffffff8170cfaa
RDX: dffffc0000000000 RSI: ffffffff8c0acaa0 RDI: 0000000000000001
RBP: ffffc900048275d0 R08: ffffffff942d08af R09: 1ffffffff285a115
R10: dffffc0000000000 R11: fffffbfff285a116 R12: dffffc0000000000
R13: 1ffff92000904ea8 R14: ffffc90004827560 R15: 0000000000000246
 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
 __skb_try_recv_datagram+0x1cb/0x6a0 net/core/datagram.c:266
 __unix_dgram_recvmsg+0x3ba/0x12f0 net/unix/af_unix.c:2435
 sock_recvmsg_nosec+0x190/0x1d0 net/socket.c:1051
 ____sys_recvmsg+0x3cd/0x480 net/socket.c:2824
 ___sys_recvmsg net/socket.c:2868 [inline]
 do_recvmmsg+0x45e/0xad0 net/socket.c:2962
 __sys_recvmmsg net/socket.c:3041 [inline]
 __do_sys_recvmmsg net/socket.c:3064 [inline]
 __se_sys_recvmmsg net/socket.c:3057 [inline]
 __x64_sys_recvmmsg+0x199/0x250 net/socket.c:3057
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fed2857e759
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fed269f6038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007fed28736058 RCX: 00007fed2857e759
RDX: 0000000000010106 RSI: 00000000200000c0 RDI: 0000000000000009
RBP: 00007fed285f175e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fed28736058 R15: 00007ffea87f0048
 </TASK>
----------------
Code disassembly (best guess):
   0:	9c                   	pushf
   1:	8f 44 24 20          	pop    0x20(%rsp)
   5:	42 80 3c 23 00       	cmpb   $0x0,(%rbx,%r12,1)
   a:	74 08                	je     0x14
   c:	4c 89 f7             	mov    %r14,%rdi
   f:	e8 0e 32 2d f6       	call   0xf62d3222
  14:	f6 44 24 21 02       	testb  $0x2,0x21(%rsp)
  19:	75 52                	jne    0x6d
  1b:	41 f7 c7 00 02 00 00 	test   $0x200,%r15d
  22:	74 01                	je     0x25
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 f3 a9 91 f5       	call   0xf591aa22 <-- trapping instruction
  2f:	65 8b 05 b4 41 32 74 	mov    %gs:0x743241b4(%rip),%eax        # 0x743241ea
  36:	85 c0                	test   %eax,%eax
  38:	74 43                	je     0x7d
  3a:	48                   	rex.W
  3b:	c7                   	.byte 0xc7
  3c:	04 24                	add    $0x24,%al
  3e:	0e                   	(bad)
  3f:	36                   	ss

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/18 15:12 upstream adc218676eef 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/11/17 17:13 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/10/14 12:15 upstream 6485cf5ea253 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/10/04 22:41 upstream 360c1f1f24c6 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/08/27 05:23 upstream 5be63fc19fca 9aee4e0b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/08/03 01:28 upstream 948752d2e010 53683cf2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
2024/07/07 21:10 upstream c6653f49e4fd bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in sched_tick
* Struck through repros no longer work on HEAD.