syzbot


WARNING in gnet_stats_add_basic
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: e22db7bd552f net: sched: Allow statistics reads from softirq.
First crash: 218d, last: 217d

Cause bisection: introduced by (bisect log) :
commit 29cbcd85828372333aa87542c51f2b2b0fd4380c
Author: Ahmed S. Darwish <a.darwish@linutronix.de>
Date: Sat Oct 16 08:49:10 2021 +0000

  net: sched: Remove Qdisc::running sequence counter

Crash: WARNING in gnet_stats_add_basic (log)
Repro: C syz .config

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at net/core/gen_stats.c:157 gnet_stats_add_basic+0x4d/0x2a0 net/core/gen_stats.c:157
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:gnet_stats_add_basic+0x4d/0x2a0 net/core/gen_stats.c:157
Code: 0f 84 69 01 00 00 e8 52 a1 59 fa 31 ff 65 8b 2d b9 ab e4 78 81 e5 00 01 ff 00 89 ee e8 7c a8 59 fa 85 ed 74 10 e8 33 a1 59 fa <0f> 0b 4d 85 f6 0f 84 70 01 00 00 49 c7 c7 64 b1 6e 8d bd ff ff ff
RSP: 0018:ffffc90000007b98 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8880143b7820 RCX: 0000000000000100
RDX: ffffffff8b6bc640 RSI: ffffffff871d445d RDI: 0000000000000003
RBP: 0000000000000100 R08: 0000000000000000 R09: 0000000000000001
R10: ffffffff871d45d0 R11: 0000000000000000 R12: ffff88801f08e808
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000440 CR3: 000000000b68e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 est_fetch_counters+0xc3/0x160 net/core/gen_estimator.c:69
 est_timer+0x92/0x730 net/core/gen_estimator.c:83
 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
 expire_timers kernel/time/timer.c:1466 [inline]
 __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734
 __run_timers kernel/time/timer.c:1715 [inline]
 run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 invoke_softirq kernel/softirq.c:432 [inline]
 __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648
 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:132 [inline]
RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:110 [inline]
RIP: 0010:acpi_idle_do_entry+0x1c6/0x250 drivers/acpi/processor_idle.c:553
Code: 89 de e8 4d c1 3b f8 84 db 75 ac e8 04 bb 3b f8 e8 8f e4 41 f8 eb 0c e8 f8 ba 3b f8 0f 00 2d 01 b8 b4 00 e8 ec ba 3b f8 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 37 c0 3b f8 48 85 db
RSP: 0018:ffffffff8b607d60 EFLAGS: 00000293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffffffff8b6bc640 RSI: ffffffff893b2aa4 RDI: 0000000000000000
RBP: ffff888012bc9864 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff817d0f58 R11: 0000000000000000 R12: 0000000000000001
R13: ffff888012bc9800 R14: ffff888012bc9864 R15: ffff888018c09804
 acpi_idle_enter+0x361/0x500 drivers/acpi/processor_idle.c:688
 cpuidle_enter_state+0x1b1/0xc80 drivers/cpuidle/cpuidle.c:237
 cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:351
 call_cpuidle kernel/sched/idle.c:158 [inline]
 cpuidle_idle_call kernel/sched/idle.c:239 [inline]
 do_idle+0x3e8/0x590 kernel/sched/idle.c:306
 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:403
 start_kernel+0x47a/0x49b init/main.c:1141
 secondary_startup_64_no_verify+0xb0/0xbb
----------------
Code disassembly (best guess):
   0:	89 de                	mov    %ebx,%esi
   2:	e8 4d c1 3b f8       	callq  0xf83bc154
   7:	84 db                	test   %bl,%bl
   9:	75 ac                	jne    0xffffffb7
   b:	e8 04 bb 3b f8       	callq  0xf83bbb14
  10:	e8 8f e4 41 f8       	callq  0xf841e4a4
  15:	eb 0c                	jmp    0x23
  17:	e8 f8 ba 3b f8       	callq  0xf83bbb14
  1c:	0f 00 2d 01 b8 b4 00 	verw   0xb4b801(%rip)        # 0xb4b824
  23:	e8 ec ba 3b f8       	callq  0xf83bbb14
  28:	fb                   	sti
  29:	f4                   	hlt
* 2a:	9c                   	pushfq <-- trapping instruction
  2b:	5b                   	pop    %rbx
  2c:	81 e3 00 02 00 00    	and    $0x200,%ebx
  32:	fa                   	cli
  33:	31 ff                	xor    %edi,%edi
  35:	48 89 de             	mov    %rbx,%rsi
  38:	e8 37 c0 3b f8       	callq  0xf83bc074
  3d:	48 85 db             	test   %rbx,%rbx

Crashes (14):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-kasan-gce 2021/10/19 05:01 net-next f616447034a1 24dc29db .config log report syz C WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/19 04:36 net-next f616447034a1 24dc29db .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/19 01:33 net-next f616447034a1 24dc29db .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 15:23 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 15:18 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 15:12 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 15:04 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 14:25 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 14:16 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 14:10 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 13:18 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 13:02 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 12:55 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic
ci-upstream-net-kasan-gce 2021/10/18 12:27 net-next d40dfa0cebd8 0c5d9412 .config log report info WARNING in gnet_stats_add_basic