arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

KernelScript:用于eBPF应用程序的跨边界类型化领域特定语言

KernelScript: Cross-Boundary Typed DSL for eBPF Applications

Cong Wang, Siyuan Sun, Yusheng Zheng

arXiv 2607.23900首次发表:更新:

AI 中文总结

研究eBPF编程模型碎片化问题,提出KernelScript DSL,它能在一个源文件中对相关元素类型化并编译为标准C,经实验评估,可在编译时拒绝跨边界错误,缩小跨边界更改差异且代码与现有工具链兼容。

AI 中文摘要

eBPF允许开发人员通过自定义数据包处理、跟踪和调度逻辑扩展Linux,并且有一个验证器在执行前证明代码不会使内核崩溃。然而,编程模型是碎片化的:单个应用程序跨越内核代码、用户空间加载器和共享映射,但这些部分之间的关系未得到检查。例如,在每一侧以不同方式定义的映射或事件类型会悄无声息地破坏共享状态。我们发现这些跨边界关系重复了类型系统可以统一的信息。我们提出了KernelScript,一种在一个源文件中对映射、程序句柄和执行域进行类型化,然后通过原始工具链编译为标准C的领域特定语言。我们在涵盖XDP、TC、kprobe、tracepoint和struct_ops的43个eBPF工作负载上评估了KernelScript。KernelScript在编译时拒绝标准C/libbpf仍会构建和加载的跨边界错误,统一的源文件将跨边界更改的差异缩小了5倍,并且生成的代码与现有工具链保持兼容。

英文摘要

eBPF lets developers extend Linux with custom packet processing, tracing, and scheduling logic, and a verifier proves before execution that the code will not crash the kernel. The programming model, however, is fragmented: a single application spans kernel code, a userspace loader, and shared maps, yet the relationships among these pieces go unchecked. E.g. A map or event type defined differently on each side silently corrupts shared state. We observe that these cross-boundary relationships duplicate information that a type system can unify. We present KernelScript, a DSL that types maps, program handles, and execution domains in one source, then compiles to standard C through the original toolchain. We evaluate KernelScript on 43 eBPF workloads covering XDP, TC, kprobe, tracepoint, and struct_ops. KernelScript rejects cross-boundary bugs at compile time that standard C/libbpf still builds and loads, a unified source shrinks the diffs for cross-boundary changes by 5x, and generated code remains compatible with the existing toolchain.

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑