INFO: rcu detected stall in batadv_bla_periodic_work (2)

Status: upstream: reported syz repro on 2024/09/17 15:14
Subsystems: batman
Labels: prio:normal
[Documentation on labels]
Reported-by: syzbot+fc38cf2d6e727d8415c7@syzkaller.appspotmail.com
First crash: 800d, last: 207d
Cause bisection: failed (error log, bisect log)
Fix bisection: failed (error log, bisect log)
✨ AI-generated root cause summary:

The taprio qdisc allows configuring schedule entries with extremely short intervals (e.g. 3250 ns on virtual interfaces). When the taprio advance_timer fires, its callback advance_sched() in net/sched/sch_taprio.c increments end_time by only a single interval (next->interval) and returns HRTIMER_RESTART instead of forwarding past the current time. When the execution and interrupt handling overhead approaches or exceeds this interval, __hrtimer_run_queues() repeatedly requeues and re-executes the timer in hardirq context to catch up to the current time. This results in severe CPU saturation in hardirq context, starving tasks (such as a batadv worker running under rcu_read_lock()) from releasing RCU read locks or reporting quiescent states, which ultimately triggers expedited RCU stalls.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 196145c606d0:

Root Cause Analysis

1. Mechanism and Trigger

The bug report shows an expedited RCU CPU stall warning where CPU 0 failed to report a quiescent state (0-...D), while running in a hardirq context triggered during the execution of batadv_bla_periodic_work:

Workqueue: bat_events batadv_bla_periodic_work
batadv_bla_purge_claims+0x160/0x780 net/batman-adv/bridge_loop_avoidance.c:1289

At line 1289 of net/batman-adv/bridge_loop_avoidance.c, batadv_bla_purge_claims() acquired rcu_read_lock() and was interrupted by hrtimer_interrupt(). The batman-adv work item is not the root cause, but rather an innocent victim that was preempted by hardirq processing while holding an RCU read lock.

The root cause resides in the Time-Aware Priority (taprio) scheduler (net/sched/sch_taprio.c):

  1. Low interval validation threshold: When taprio_change() parses a schedule entry via fill_sched_entry(), it enforces a minimum interval based on length_to_duration(q, ETH_ZLEN). On virtual network interfaces (such as team0, configured in the reproducer), this minimum duration can be extremely small or zero because link speed queries fail or default to high speeds, allowing userspace to configure schedule intervals as small as 3250 ns (0xcb2 in the reproducer).
  2. Sub-execution-time advance in advance_sched():
    • Taprio uses an hrtimer (q->advance_timer) configured with advance_sched() as its callback function (net/sched/sch_taprio.c:912).
    • When advance_sched() expires, it advances end_time by only a single schedule interval:
      end_time = ktime_add_ns(entry->end_time, next->interval);
      ...
      hrtimer_set_expires(&q->advance_timer, end_time);
      return HRTIMER_RESTART;
      
    • Crucially, advance_sched() does not use hrtimer_forward() or hrtimer_forward_now() to leap past the current wall-clock time if the timer has lagged behind.
  3. Infinite/tight loop in __hrtimer_run_queues():
    • In kernel/time/hrtimer.c:1733, __hrtimer_run_queues() runs active timers in a loop:
      while ((node = timerqueue_getnext(&base->active))) {
          timer = container_of(node, struct hrtimer, node);
          if (basenow < hrtimer_get_softexpires_tv64(timer))
              break;
          __run_hrtimer(cpu_base, base, timer, &basenow, flags);
      }
      
    • Whenever the timer callback execution overhead plus interrupt overhead ($E$) exceeds or is comparable to the scheduled interval ($I = 3250\text{ ns}$), any slight latency $\Delta t$ causes the timer to fall behind.
    • Because basenow is fixed across the while loop iterations and the timer advances its expiration by only $I$ on each iteration, catching up a lag of $\Delta t$ requires $\Delta t / I$ iterations, taking $(\Delta t / I) \cdot E > \Delta t$ of wall-clock time.
    • When __hrtimer_run_queues() returns to hrtimer_interrupt(), hrtimer_update_base() observes that time has moved forward even further, repeatedly retrying or firing immediately.
  4. Hardirq saturation and RCU stall:
    • The CPU becomes trapped handling hrtimer_interrupt / advance_sched() almost continuously in hardirq context.
    • As a result, the interrupted task (batadv_bla_purge_claims) running on CPU 0 under rcu_read_lock() cannot make forward progress to rcu_read_unlock() or report a quiescent state.
    • Another CPU (CPU 1) waiting for an expedited grace period (synchronize_rcu_expedited()) times out after 2684 jiffies, triggering the expedited RCU stall warning and sending an NMI to CPU 0.

Affected Files and Entities

  • Source File: net/sched/sch_taprio.c
  • Functions: advance_sched(), fill_sched_entry(), taprio_change()
  • Structs/Fields: struct taprio_sched::advance_timer, struct sched_entry::interval
▶ ▼ ✨ AI Jobs (10)
ID Workflow Result Correct Bug Created Started Finished Revision
2ef785a9 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ✅ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/11/09 05:22 2026/11/09 05:22 2026/11/09 06:15 5cecaf1f
3c68f2a7 assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/10/09 03:56 2026/10/09 03:56 2026/10/09 04:25 723be09b
6314f6be assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/09/09 03:24 2026/09/09 03:24 2026/09/09 03:46 243b72f1
be1994e5 assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/08/09 21:36 2026/08/09 21:36 2026/08/09 21:52 5d63f80b
89ecebb5 assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/07/09 01:01 2026/07/09 01:01 2026/07/09 01:28 93f57954
351dba68 assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/06/22 02:33 2026/06/22 02:33 2026/06/22 02:56 43bfcdb0
ad536fba assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/06/14 02:12 2026/06/14 02:12 2026/06/14 02:43 4f06757f
4667d63a assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/06/09 18:06 2026/06/09 18:06 2026/06/09 18:32 c36c07f6
0bd3a892 assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/06/02 15:09 2026/06/02 15:09 2026/06/02 15:41 62fe1528
64fb639b assessment-security 💥 INFO: rcu detected stall in batadv_bla_periodic_work (2) 2026/05/25 10:57 2026/05/25 10:57 2026/05/25 11:16 c69befb3
▶ ▼ Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly batman report (Dec 2025) 0 (1) 2025/12/22 13:07
[syzbot] Monthly batman report (Mar 2025) 0 (1) 2025/03/03 10:39
[syzbot] [batman?] INFO: rcu detected stall in batadv_bla_periodic_work (2) 0 (1) 2024/09/17 15:14
▶ ▼ Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: rcu detected stall in batadv_bla_periodic_work 1 1 745d 745d 0/3 auto-obsoleted due to no activity on 2025/02/16 00:06
upstream INFO: rcu detected stall in batadv_bla_periodic_work net 1 1 1108d 1108d 0/29 auto-obsoleted due to no activity on 2024/02/09 07:47
linux-6.1 INFO: rcu detected stall in batadv_bla_periodic_work (2) 1 2 514d 541d 0/3 auto-obsoleted due to no activity on 2025/10/05 07:27
linux-5.15 INFO: rcu detected stall in batadv_bla_periodic_work 1 1 761d 761d 0/3 auto-obsoleted due to no activity on 2025/01/30 13:51
▶ ▼ Last patch testing requests (10)
Created Duration User Patch Repo Result
2026/11/14 12:39 26m retest repro upstream report job log log
2026/10/26 08:17 1h00m retest repro linux-next no crash job log log
2026/09/02 04:23 31m retest repro upstream report job log log
2026/08/16 23:12 0m retest repro linux-next error job log
2026/06/21 13:16 38m retest repro upstream log
2026/06/06 02:17 3h54m retest repro linux-next error
2026/04/12 06:12 32m retest repro upstream report log
2026/04/12 06:05 26m retest repro upstream report log
2026/03/27 08:29 18m retest repro linux-next report log
2026/01/16 04:21 1h02m retest repro linux-next report log
▶ ▼ Fix bisection attempts (8)
Created Duration User Patch Repo Result
2026/02/01 04:36 12m bisect fix upstream error job log
2025/12/21 17:51 2h21m bisect fix upstream OK (0) job log log
2025/07/02 22:12 2h15m bisect fix upstream OK (0) job log log
2025/05/20 13:05 3h19m bisect fix upstream OK (0) job log log
2025/03/31 21:06 4h41m bisect fix upstream OK (0) job log log
2025/03/01 19:00 2h04m bisect fix upstream OK (0) job log log
2025/01/30 10:14 6h19m bisect fix upstream OK (0) job log log
2024/10/14 17:48 2h15m bisect fix upstream OK (0) job log log

Sample crash report:
rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { 0-...D } 2684 jiffies s: 3397 root: 0x1/.
rcu: blocking rcu_node structures (internal RCU debug):
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 29 Comm: kworker/u8:2 Not tainted 6.11.0-rc7-syzkaller-00097-g196145c606d0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Workqueue: bat_events batadv_bla_periodic_work
RIP: 0010:kasan_check_range+0x14f/0x1a0 mm/kasan/generic.c:190
Code: 83 c0 01 49 89 d3 48 39 d0 74 11 80 38 00 74 ef 4d 8d 1c 2c 48 85 c0 48 89 c2 75 93 48 89 da 4c 89 d8 4c 29 da e9 2c ff ff ff <5b> b8 01 00 00 00 5d 41 5c c3 cc cc cc cc b8 01 00 00 00 c3 cc cc
RSP: 0018:ffffc90000007a68 EFLAGS: 00000046
RAX: fffffbfff2d248e1 RBX: fffffbfff2d248e1 RCX: ffffffff8168d93e
RDX: fffffbfff2d248e1 RSI: 0000000000000008 RDI: ffffffff96924700
RBP: fffffbfff2d248e0 R08: 0000000000000000 R09: fffffbfff2d248e0
R10: ffffffff96924707 R11: 0000000000000000 R12: 0000000000000002
R13: ffff88801d698b58 R14: 0000000000000001 R15: ffff88801d698000
FS:  0000000000000000(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557158cde858 CR3: 000000000db7c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <IRQ>
 instrument_atomic_read include/linux/instrumented.h:68 [inline]
 _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
 hlock_class+0x4e/0x130 kernel/locking/lockdep.c:227
 check_wait_context kernel/locking/lockdep.c:4772 [inline]
 __lock_acquire+0x415/0x3cb0 kernel/locking/lockdep.c:5092
 lock_acquire kernel/locking/lockdep.c:5759 [inline]
 lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
 debug_object_activate+0x199/0x540 lib/debugobjects.c:709
 debug_hrtimer_activate kernel/time/hrtimer.c:423 [inline]
 debug_activate kernel/time/hrtimer.c:478 [inline]
 enqueue_hrtimer+0x25/0x3c0 kernel/time/hrtimer.c:1085
 __run_hrtimer kernel/time/hrtimer.c:1706 [inline]
 __hrtimer_run_queues+0xaac/0xcc0 kernel/time/hrtimer.c:1753
 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1815
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
 __sysvec_apic_timer_interrupt+0x10f/0x450 arch/x86/kernel/apic/apic.c:1049
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:bytes_is_nonzero mm/kasan/generic.c:87 [inline]
RIP: 0010:memory_is_nonzero mm/kasan/generic.c:104 [inline]
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:129 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:161 [inline]
RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
RIP: 0010:kasan_check_range+0x111/0x1a0 mm/kasan/generic.c:189
Code: 44 89 c2 e8 a1 ea ff ff 83 f0 01 5b 5d 41 5c c3 cc cc cc cc 48 85 d2 74 4f 48 01 ea eb 09 48 83 c0 01 48 39 d0 74 41 80 38 00 <74> f2 eb b2 41 bc 08 00 00 00 45 29 dc 49 8d 14 2c eb 0c 48 83 c0
RSP: 0018:ffffc90000a57a58 EFLAGS: 00000246
RAX: fffffbfff20289b3 RBX: fffffbfff20289b4 RCX: ffffffff8169d04b
RDX: fffffbfff20289b4 RSI: 0000000000000008 RDI: ffffffff90144d98
RBP: fffffbfff20289b3 R08: 0000000000000000 R09: fffffbfff20289b3
R10: ffffffff90144d9f R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffffffff8ddb9fe0 R15: 0000000000000000
 instrument_atomic_read include/linux/instrumented.h:68 [inline]
 _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
 cpumask_test_cpu include/linux/cpumask.h:562 [inline]
 cpu_online include/linux/cpumask.h:1105 [inline]
 trace_lock_acquire include/trace/events/lock.h:24 [inline]
 lock_acquire+0xbb/0x560 kernel/locking/lockdep.c:5730
 rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
 rcu_read_lock include/linux/rcupdate.h:838 [inline]
 batadv_bla_purge_claims+0x160/0x780 net/batman-adv/bridge_loop_avoidance.c:1289
 batadv_bla_periodic_work+0x51/0x9e0 net/batman-adv/bridge_loop_avoidance.c:1444
 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231
 process_scheduled_works kernel/workqueue.c:3312 [inline]
 worker_thread+0x6c8/0xf00 kernel/workqueue.c:3393
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/13 15:05 upstream 196145c606d0 73e8a465 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root INFO: rcu detected stall in batadv_bla_periodic_work
2026/04/30 09:43 linux-next 0787c45ea08a 005438fc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: rcu detected stall in batadv_bla_periodic_work
2026/01/02 03:34 linux-next cc3aa43b44bd d6526ea3 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci-upstream-linux-next-kasan-gce-root INFO: rcu detected stall in batadv_bla_periodic_work
2025/11/21 16:58 linux-next d724c6f85e80 c31c1b0b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: rcu detected stall in batadv_bla_periodic_work
* Struck through repros no longer work on HEAD.