panic: runtime error: floating point error [recovered] (2)

Status: upstream: reported syz repro on 2024/12/22 14:57
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+4fb57f15e8c895a21973@syzkaller.appspotmail.com
First crash: 717d, last: 633d
✨ AI-generated root cause summary:

A BPF program of type BPF_PROG_TYPE_RAW_TRACEPOINT was loaded with instructions invoking the bpf_send_signal() helper with signal 8 (SIGFPE) and attached system-wide to the mm_page_alloc raw tracepoint via BPF_RAW_TRACEPOINT_OPEN. In kernel/trace/bpf_trace.c, bpf_send_signal_common() delivers the signal with SEND_SIG_PRIV (si_code = SI_KERNEL = 0x80) directly to current whenever the tracepoint fires, lacking any filtering by PID or TGID. When the userspace syzkaller runner process allocated memory while serializing a program, mm_page_alloc fired and sent SIGFPE to the runner; Go's runtime caught the signal and raised a userspace "panic: runtime error: floating point error", which syzkaller's crash monitor misidentified as a kernel panic.

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

Technical Root Cause Analysis

1. Involved Subsystems, Files, Functions, and Structures


2. Detailed Technical Breakdown and Trigger Mechanism

A. BPF Program Loading & Tracepoint Attachment

The reproducer loads a BPF raw tracepoint program (BPF_PROG_TYPE_RAW_TRACEPOINT) with four instructions:

  1. BPF_LD_IMM64(r1, 8): Load immediate value 8 (SIGFPE) into register r1.
  2. BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_send_signal): Call BPF helper function 109 (bpf_send_signal).
  3. BPF_EXIT_INSN(): Terminate program execution.

It then attaches this BPF program via the BPF_RAW_TRACEPOINT_OPEN command (bpf_raw_tracepoint_open() in kernel/bpf/syscall.c) to the global mm_page_alloc tracepoint.

B. Signal Delivery via bpf_send_signal

In kernel/trace/bpf_trace.c:

  • When raw_tp_prog_func_proto() checks available helper functions for raw tracepoint programs, it returns bpf_send_signal_proto via bpf_tracing_func_proto().
  • When called, bpf_send_signal(u32 sig) calls bpf_send_signal_common(sig, PIDTYPE_TGID, NULL, 0).
  • Because task is NULL, it defaults to targeting current:
    if (!task) {
        task = current;
        siginfo = SEND_SIG_PRIV;
    }
    
  • Beyond ensuring that current is not a kernel thread, not exiting, not PID 1, and in a state where user memory access is allowed, bpf_send_signal_common() performs no verification of target PID/TGID or caller-to-target relationship. It sends the signal using SEND_SIG_PRIV (group_send_sig_info(sig, SEND_SIG_PRIV, task, type) or via queued irq_work), which bypasses standard permission checks (check_kill_permission()).
  • Under SEND_SIG_PRIV, the kernel assigns si_code = SI_KERNEL (0x80).
C. Interaction with Userspace and the Syzkaller Runner Crash
  • The tracepoint mm_page_alloc is called whenever any task in any context on any CPU allocates a page.
  • The BPF program contains no filtering logic (e.g., checking bpf_get_current_pid_tgid()). Consequently, whenever any userspace process triggers a page allocation, the tracepoint fires, executing bpf_send_signal(8) and immediately delivering asynchronous SIGFPE (code=0x80) to the currently executing process.
  • While the userspace Go process (syzkaller's rpcserver.(*Runner)) was serializing a test program (Prog.Serialize -> fmt.Fprintf -> bytes.(*Buffer).grow -> bytes.growSlice), it allocated memory and faulted/allocated a page.
  • This allocation triggered mm_page_alloc, causing bpf_send_signal() to queue/send SIGFPE (code=0x80) directly to the runner thread.
  • The Go runtime intercepted the SIGFPE signal and converted it into a Go panic (runtime error: floating point error), which bytes.growSlice.func1's deferred handler recovered and re-raised as panic: bytes.Buffer: too large. Syzkaller's monitoring logic saw the userspace panic output on standard output/console and mistakenly logged it as a kernel panic report.
▶ ▼ ✨ AI Jobs (10)
ID Workflow Result Correct Bug Created Started Finished Revision
f6605983 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ✅ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ panic: runtime error: floating point error [recovered] (2) 2026/11/09 01:21 2026/11/09 01:21 2026/11/09 01:50 5cecaf1f
03112e4f assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/10/09 01:50 2026/10/09 01:50 2026/10/09 02:20 723be09b
fa5a7a49 assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/09/09 01:46 2026/09/09 01:46 2026/09/09 02:14 243b72f1
0148a190 assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/08/09 16:22 2026/08/09 16:22 2026/08/09 16:38 5d63f80b
4374ddae assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/07/08 01:08 2026/07/08 01:08 2026/07/08 01:36 93f57954
3ed8fad6 assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/06/22 01:04 2026/06/22 01:04 2026/06/22 01:33 43bfcdb0
967fc3ee assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/06/14 00:53 2026/06/14 00:53 2026/06/14 01:19 4f06757f
95957c00 assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/06/09 15:38 2026/06/09 15:38 2026/06/09 16:01 c36c07f6
fb83752c assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/06/02 10:26 2026/06/02 10:26 2026/06/02 10:56 1095583b
6240c1e2 assessment-security 💥 panic: runtime error: floating point error [recovered] (2) 2026/05/24 01:25 2026/05/24 01:25 2026/05/24 01:55 c69befb3
▶ ▼ Discussions (1)
Title Replies (including bot) Last reply
[syzbot] panic: runtime error: floating point error [recovered] (2) 0 (1) 2024/12/22 14:57
▶ ▼ Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 panic: runtime error: floating point error [recovered] 2 1 966d 966d 0/2 auto-obsoleted due to no activity on 2024/07/13 09:12
android-5-15 panic: runtime error: floating point error [recovered] (2) 2 1 984d 984d 0/2 auto-obsoleted due to no activity on 2024/06/25 05:19
android-6-1 panic: runtime error: floating point error [recovered] 2 3 980d 997d 0/2 auto-obsoleted due to no activity on 2024/06/29 09:32
upstream panic: runtime error: floating point error [recovered] 2 2 966d 982d 0/30 auto-obsoleted due to no activity on 2024/07/13 03:37
android-5-15 panic: runtime error: floating point error [recovered] 2 1 1452d 1452d 0/2 auto-obsoleted due to no activity on 2023/04/11 07:35
▶ ▼ Last patch testing requests (10)
Created Duration User Patch Repo Result
2026/12/02 23:31 18m retest repro upstream report job log log
2026/09/23 21:51 15m retest repro upstream job log log
2026/07/15 20:07 21m retest repro upstream report log
2026/05/06 19:44 19m retest repro upstream log
2026/02/25 18:45 14m retest repro upstream report log
2025/12/17 17:54 12m retest repro upstream report log
2025/10/08 17:35 15m retest repro upstream report log
2025/07/30 16:59 20m retest repro upstream log
2025/05/21 15:45 13m retest repro upstream report log
2025/03/12 15:24 13m retest repro upstream report log

Sample crash report:
panic: runtime error: floating point error [recovered]
	panic: bytes.Buffer: too large
[signal SIGFPE: floating-point exception code=0x80 addr=0x0 pc=0x474d52]

goroutine 7 [running]:
bytes.growSlice.func1()
	/usr/local/go/src/bytes/buffer.go:232 +0x45
panic({0x128f240?, 0x297a930?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
bytes.growSlice({0xc007442800, 0x200, 0x1?}, 0x800?)
	/usr/local/go/src/bytes/buffer.go:249 +0xb9
bytes.(*Buffer).grow(0xc001b1c5a0, 0x1)
	/usr/local/go/src/bytes/buffer.go:151 +0x13d
bytes.(*Buffer).Write(0xc001b1c5a0, {0xc001e70800, 0x1, 0x0?})
	/usr/local/go/src/bytes/buffer.go:179 +0x59
fmt.Fprintf({0x1c7d9c0, 0xc001b1c5a0}, {0x1c1a3b0, 0x1}, {0x0, 0x0, 0x0})
	/usr/local/go/src/fmt/print.go:225 +0x97
github.com/google/syzkaller/prog.(*serializer).printf(...)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:64
github.com/google/syzkaller/prog.(*PointerArg).serialize(0xc001d8a990, 0xc001b1c600)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:142 +0x271
github.com/google/syzkaller/prog.(*serializer).arg(0x1c7d9c0?, {0x1c9c180?, 0xc001d8a990?})
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:125 +0x29
github.com/google/syzkaller/prog.(*GroupArg).serialize(0xc001d70f20, 0xc001b1c600)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:203 +0x26d
github.com/google/syzkaller/prog.(*serializer).arg(0x1c7d9c0?, {0x1c9c240?, 0xc001d70f20?})
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:125 +0x29
github.com/google/syzkaller/prog.(*PointerArg).serialize(0xc001d8ac30, 0xc001b1c600)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:146 +0x38e
github.com/google/syzkaller/prog.(*serializer).arg(0x1c7d9c0?, {0x1c9c180?, 0xc001d8ac30?})
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:125 +0x29
github.com/google/syzkaller/prog.(*serializer).call(0xc001b1c600, 0xc0007b6190)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:86 +0x216
github.com/google/syzkaller/prog.(*Prog).serialize(0xc000ca7280, 0x0)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:46 +0xd8
github.com/google/syzkaller/prog.(*Prog).Serialize(...)
	/syzkaller/gopath/src/github.com/google/syzkaller/prog/encoding.go:30
github.com/google/syzkaller/pkg/rpcserver.(*Runner).handleExecutingMessage(0xc0002746c0, 0xc007431308)
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/rpcserver/runner.go:371 +0x217
github.com/google/syzkaller/pkg/rpcserver.(*Runner).ConnectionLoop(0xc0002746c0)
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/rpcserver/runner.go:201 +0x4b9
github.com/google/syzkaller/pkg/rpcserver.(*server).connectionLoop(0xc0016da300, 0xc0002746c0)
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/rpcserver/rpcserver.go:356 +0x105
github.com/google/syzkaller/pkg/rpcserver.(*server).handleRunnerConn(0xc0016da300, 0xc0002746c0, 0xc00193e140)
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/rpcserver/rpcserver.go:294 +0x411
github.com/google/syzkaller/pkg/rpcserver.(*server).handleConn(0xc0016da300, 0xc00193e140)
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/rpcserver/rpcserver.go:261 +0x2b6
github.com/google/syzkaller/pkg/flatrpc.ListenAndServe.func1.1()
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/flatrpc/conn.go:55 +0x122
created by github.com/google/syzkaller/pkg/flatrpc.ListenAndServe.func1 in goroutine 53
	/syzkaller/gopath/src/github.com/google/syzkaller/pkg/flatrpc/conn.go:52 +0xb1

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/18 14:49 upstream aef25be35d23 1432fc84 .config console log report syz / log [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream panic: runtime error: floating point error [recovered]
* Struck through repros no longer work on HEAD.