Beyond Edge Coverage: Per-Task Data-Flow Extraction at Kernel Function Boundaries via LLVM

Yunseong Kim · 2026

Read Beyond Edge Coverage: Per-Task Data-Flow Extraction at Kernel Function Boundaries via LLVM by Yunseong Kim (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-00455.txt.

Introduction

Kim extends kernel bug hunts past edge counts to per-task data flows at call walls. Kernel fuzz tools like syzkaller feed on edge counts alone. That feed is blind to the values a call takes in. Two calls with split size marks hit the same blocks yet pose split risks.

His LLVM frame grows the stock KCOV feed with value reads. A build pass pings one source trait per call, with size and slot marks. Big forms are pinged by their home, with a field map from debug data. No source marks are a must from the coder's hand. A lock-free per-task log ships the reads to user space. Fuzz tools gain state-wise hints, and flaw hunts gain firm logs.

Catalog record

CREATORYunseong Kim
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE58 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2606.00455

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Beyond Edge Coverage: Per-Task Data-Flow Extraction at Kernel Function Boundaries via LLVM Yunseong Kim Abstract Coverage-guided kernel fuzzers such as syzkaller rely on edge coverage ( trace-pc ) as their sole feedback signal. This context-blind approach cannot distinguish execution paths that differ only in argument values—for example, two invocations of copy_from_user() with different size parameters hit identical basic blocks yet have vastly different security implications. I present kcov-dataflow , an LLVM-based instrumentation framework that extends Linux KCOV with data-flow extraction of function arguments and return values. A compiler pass emits lightweight callbacks capturing structured tuples of program counter, argument metadata, and field values at function entry and return. Composite types are automatically decomposed via DWARF DICompositeType metadata with zero source annotation. A lock-free per-task ring buffer delivers records to user space with no interference to existing KCOV or syzkaller infrastructure. I demonstrate dual utility: (1) fuzzers gain state-aware feedback for mutation guidance into value-dependent state transitions, and (2) security analysts obtain deterministic argument records for root-cause analysis without printk or kprobe overhead. Two Rust instrumentation paths are provided: a post-compilation pipeline requiring no rustc modification, and native instrumentation via rustc built against the custom LLVM—both the only runtime methods for capturing Rust function arguments given that drgn /vmcore fails under -O2 DWARF elision. Keywords Kernel Fuzzing \cdot Data-Flow Extraction \cdot LLVM Instrumentation \cdot KCOV \cdot Rust for Linux 1 Introduction The Linux kernel exceeds 40 million lines of code, integrates Rust(( \sim 397k Lines) Lines) as a second systems language, and implements complex locking hierarchies ( rwsem , mutex , RCU) that create deep state spaces unreachable by coverage-guided fuzzing alone. syzkaller [ 1 ] has discovered over 5,000 kernel bugs in the linux kernel, yet plateaus on stateful subsystems such as ksmbd , io_uring , and binder where security-critical behavior depends on runtime argument values rather than control-flow topology. The fundamental limitation is a semantic gap : KCOV’s trace-pc reports which basic blocks executed but not with what values . Two executions of vfs_open() with different access-mode flags traverse identical edges yet have entirely different security implications. Fuzzers cannot distinguish these without data-flow context, leading to coverage saturation on value-dependent state transitions. Prior approaches each fall short for kernel-scale deployment. Dynamic tracing via ftrace / kprobes imposes per-function overhead unsuitable for continuous fuzzing. IJON [ 2 ] requires manual annotation—infeasible for 30M LOC. Context-sensitive coverage (Angora [ 3 ] , CollAFL [ 4 ] ) clones call sites but explodes on polymorphic dispatch ( file_operations alone has 20+ function pointers). DataFlowSanitizer provides byte-level taint tracking but imposes 10–100 \times overhead, rendering it unusable for kernel fuzzing. I observe that function boundaries are natural chokepoints where data-flow context is both cheap to capture and highly informative. Arguments encode the intent of a call; return values encode the outcome . Capturing these at compile time with a lock-free kernel transport gives both fuzzers and analysts a new dimension of observability without source annotation. kcov-dataflow is an automated LLVM IR instrumentation framework that captures the data-flow tuple \langle\mathit{PC}_{\mathrm{caller}},\mathit{arg\_idx}\times\mathit{arg\_size},\mathit{ptr},\mathit{offsets}[]\rangle at every function boundary. It operates through three layers: 1. A compiler pass that emits callbacks with struct field expansion via DWARF metadata. 2. A kernel-resident lock-free per-task ring buffer delivered through a separate /sys/kernel/debug/kcov_dataflow dedicated debugfs interface. 3. A user-space consumer interface for both fuzzer executors and human analysts. My contributions are: • An LLVM SanitizerCoverage extension 1 1 1 https://github.com/llvm/llvm-project/pull/201410 that captures function arguments and return values with automatic struct field expansion via DICompositeType metadata, requiring zero source annotation. • A lock-free, per-task kernel transport mechanism that operates safely in process context with explicit interrupt rejection, without interfering with existing KCOV or syzkaller infrastructure. • A post-compilation pipeline enabling Rust kernel module instrumentation without modifying the Rust compiler toolchain, and a native path via rustc built against the custom LLVM. • Empirical demonstration on five vulnerability classes showing that boundary data-flow context provides information unavailable through any combination of existing tools (coverage + sanitizers + post-mortem debuggers). 2 Background & Motivation 2.1 KCOV and Coverage-Guided Kernel Fuzzing KCOV [ 5 ] instruments the kernel at compile time via SanitizerCoverage ’s trace-pc callback. Each task owns a kernel-allocated buffer, memory-mapped into user space, into which the kernel writes the program counter of every executed edge. User-space fuzzers (primarily syzkaller) hash these PCs into a coverage signal, retaining inputs that discover novel edges in the corpus. This architecture has proven remarkably effective: syzkaller continuously discovers 100+ bugs per month across upstream kernels. However, coverage saturates on stateful subsystems. After initial exploration, new edges become rare, and the fuzzer degenerates into random mutation without meaningful guidance. 2.2 The Data-Flow Blind Spot Client (Fuzzer) ksmbd (Kernel) SMB2_NEGOTIATE dialect OK SMB2_SESSION_SETUP authenticated SMB2_TREE_CONNECT share bound SMB2_CREATE( DesiredAccess ) file handle \to vfs_open(flags) coverage saturates here same edges Figure 1: SMB2 protocol stages required before reaching vfs_open() . Edge coverage saturates after discovering the handshake sequence; the security-relevant DesiredAccess field inside SMB2_CREATE is invisible to control-flow feedback. Consider the ksmbd SMB2_CREATE handler. Before a file operation reaches the VFS layer, ksmbd enforces a multi-stage protocol handshake between the client (fuzzer) and the in-kernel SMB server (Figure 1 ). A fuzzer must produce valid negotiate, authenticate, and tree-connect messages before it can exercise the file-create path. Once coverage of this multi-stage sequence saturates, all subsequent CREATE requests traverse identical edges regardless of DesiredAccess —the fuzzer cannot distinguish FILE_READ_DATA from FILE_WRITE_DATA|FILE_DELETE_ON_CLOSE . With kcov-dataflow , the DesiredAccess field is captured at the smb2_open() boundary, enabling value-aware mutation guidance at deep protocol stages. A second example arises at Rust-to-C FFI boundaries. A Rust wrapper calls a C function with a struct pointer whose fields determine kernel behavior. Edge coverage sees one call site; the struct contents—which control whether a privilege check is bypassed—are invisible. Edge Coverage (KCOV) syscall() vfs_open() do_open() flags=? Sees: A \to B \to C + Data-Flow Extraction syscall() vfs_open() do_open() flags=O_WRONLY|O_TRUNC Sees: A \to B(flags=0x241) \to C Figure 2: Edge coverage reports identical paths for different argument values. Data-flow extraction reveals the security-relevant difference. do_sys_openat2(0xffffff9c, "/etc/shadow" , 0x241) build_open_flags( O_WRONLY|O_TRUNC ) 0x0 = build_open_flags() getname_flags( "/etc/shadow" , 0x0) 0xffff8880... = getname_flags() vfs_open(path, {.flags=0x241, .mode=0x1b6} ) do_dentry_open(file, inode, 0x0) security_file_open( file, 0x241 ) 0x0 = security_file_open() 0x0 = do_dentry_open() 0x4 = vfs_open() 0x4 = do_sys_openat2() Captured per-task at runtime Figure 3: Actual kcov-dataflow output for open("/etc/shadow", O_WRONLY|O_TRUNC) . Each line is a captured record showing function arguments (ENTRY) and return values (RET) with automatic struct field expansion. Indentation reflects call depth. 2.3 Threat Model and Assumptions I assume a standard kernel fuzzing threat model: an unprivileged user-space process with access to the syscall interface attempts to trigger memory corruption in kernel subsystems. KASAN/KMSAN detect the corruption once triggered; my tool provides the path to triggering it and the data for triaging it. I assume the kernel is compiled with debug information for full struct field expansion, though the system degrades gracefully to scalar-only capture without it. 3 System Design & Architecture 3.1 Overview kcov-dataflow operates as a three-layer pipeline: (1) compile-time instrumentation inserts data-flow callbacks into kernel object files, (2) a runtime transport layer delivers records to user-space via a lock-free per-task ring buffer, and (3) user-space consumers (fuzzer

Read the complete text