{"title":"bpftime: userspace eBPF Runtime for Uprobe, Syscall and Kernel-User Interactions","authors":"Yusheng Zheng, Tong Yu, Yiwei Yang, Yanpeng Hu, XiaoZheng Lai, Andrew Quinn","doi":"arxiv-2311.07923","DOIUrl":null,"url":null,"abstract":"In kernel-centric operations, the uprobe component of eBPF frequently\nencounters performance bottlenecks, largely attributed to the overheads borne\nby context switches. Transitioning eBPF operations to user space bypasses these\nhindrances, thereby optimizing performance. This also enhances configurability\nand obviates the necessity for root access or privileges for kernel eBPF,\nsubsequently minimizing the kernel attack surface. This paper introduces\nbpftime, a novel user-space eBPF runtime, which leverages binary rewriting to\nimplement uprobe and syscall hook capabilities. Through bpftime, userspace\nuprobes achieve a 10x speed enhancement compared to their kernel counterparts\nwithout requiring dual context switches. Additionally, this runtime facilitates\nthe programmatic hooking of syscalls within a process, both safely and\nefficiently. Bpftime can be seamlessly attached to any running process,\nlimiting the need for either a restart or manual recompilation. Our\nimplementation also extends to interprocess eBPF Maps within shared memory,\ncatering to summary aggregation or control plane communication requirements.\nCompatibility with existing eBPF toolchains such as clang and libbpf is\nmaintained, not only simplifying the development of user-space eBPF without\nnecessitating any modifications but also supporting CO-RE through BTF. Through\nbpftime, we not only enhance uprobe performance but also extend the versatility\nand user-friendliness of eBPF runtime in user space, paving the way for more\nefficient and secure kernel operations.","PeriodicalId":501333,"journal":{"name":"arXiv - CS - Operating Systems","volume":"495 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-11-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Operating Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2311.07923","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
In kernel-centric operations, the uprobe component of eBPF frequently
encounters performance bottlenecks, largely attributed to the overheads borne
by context switches. Transitioning eBPF operations to user space bypasses these
hindrances, thereby optimizing performance. This also enhances configurability
and obviates the necessity for root access or privileges for kernel eBPF,
subsequently minimizing the kernel attack surface. This paper introduces
bpftime, a novel user-space eBPF runtime, which leverages binary rewriting to
implement uprobe and syscall hook capabilities. Through bpftime, userspace
uprobes achieve a 10x speed enhancement compared to their kernel counterparts
without requiring dual context switches. Additionally, this runtime facilitates
the programmatic hooking of syscalls within a process, both safely and
efficiently. Bpftime can be seamlessly attached to any running process,
limiting the need for either a restart or manual recompilation. Our
implementation also extends to interprocess eBPF Maps within shared memory,
catering to summary aggregation or control plane communication requirements.
Compatibility with existing eBPF toolchains such as clang and libbpf is
maintained, not only simplifying the development of user-space eBPF without
necessitating any modifications but also supporting CO-RE through BTF. Through
bpftime, we not only enhance uprobe performance but also extend the versatility
and user-friendliness of eBPF runtime in user space, paving the way for more
efficient and secure kernel operations.