Upgrade to Pro — share decks privately, control downloads, hide ads and more …

eBPF 簡介 2026 版

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for shunghsiyu shunghsiyu
October 31, 2026

eBPF 簡介 2026 版

Avatar for shunghsiyu

shunghsiyu

October 31, 2026

More Decks by shunghsiyu

Other Decks in Technology

Transcript

  1. CNTUG meetup SP - eBPF 特輯 / eBPF Meetup Taipei

    · 2026-10-31 eBPF 簡介 2026 版 An introduction to eBPF, 2026 edition Shung-Hsi Yu · SUSE Cloud Native Taiwan User Group
  2. 今天要聊什麼 · AGENDA 01 eBPF 是什麼 02 Cloud Native 與生態系

    03 前沿與展望 04 社群與下一步 What is eBPF Cloud native & the ecosystem The frontier & outlook Community & next steps
  3. 「Linux 核心的 eBPF, 就等於瀏覽器的 JavaScript」 eBPF is to the Linux

    kernel what JavaScript is to the browser 不過有個但書:沒有 GC、不能寫無窮迴圈 程式要先過核心的邊界檢查,才准跑 Analogy from ebpf.io, “What is eBPF?” · Bill Mulligan, “The State of eBPF 2026”
  4. Kernel space / Userspace 誰能安全地寫核心? Kernel space Kernel module eBPF

    Userspace 看得到全部,但以前沒辦 填補中間,但難寫、不安 兩邊優點都要,但不想承 想寫什麼都行,但看不到 法安全寫程式 全、換版本就掛 擔 kernel module 的風險 kernel 在幹嘛 Sees everything, but historically unsafe to program Bridges the gap, but hard, unsafe, breaks across versions Kernel-level programmability, without the kernel-module risk Fully programmable, but blind to kernel state Framing adapted from Bill Mulligan, “The State of eBPF 2026” (slides)
  5. Userspace → Kernel 一個 eBPF 程式怎麼跑起來? From C source to

    a running program in the kernel Userspace Kernel C 程式 LLVM / GCC eBPF object 寫一個小函式 編譯成 eBPF 指令 prog.o 程式 + map 的 ELF 檔 SEC("xdp") int prog(...) A small C function Compile to eBPF bytecode ELF file: programs + maps bpf() syscall 載入 Verifier 驗證器 Hook 逐條路徑檢查:存 取安全、一定會結 束 掛上去,事件發生 時才執行 Checks safety before it runs Runs when the event fires ✗ 不安全 → 拒絕載入 Rejected, never runs 載入 ≠ 執行 tracepoint LSM XDP sched_ext 通過驗證只代表「可以跑」,要 attach 到 hook 上才會真的跑 Passing the verifier means it may run; attaching it to a hook is what makes it run Adapted from ebpf.io, “What is eBPF?” (libbpf diagram)
  6. 能做什麼? Networking Tracing Security(BPF LSM) CPU scheduling 網路 追蹤 安全性

    CPU 排程 理論上什麼都能做 “Anything, theoretically” Cloudflare 就拿 BPF LSM,在修補過的 kernel 上線前,大約一天內就在全機隊擋掉 AF_ALG bind——封住 CVE-2026-31431(「Copy Fail」)這個提權漏洞的攻擊路徑 Cloudflare used BPF LSM to block AF_ALG binds fleet-wide within about a day, closing the exploit path for CVE-2026-31431 (“Copy Fail”) before the patched kernel was rolled out Source: Cloudflare blog, “How Cloudflare responded to the ‘Copy Fail’ Linux vulnerability” (2026-05-07)
  7. Cloud Native 的 workload 大多跑在 Linux 上, kernel 是大家共用的地基 Cloud-native

    workloads mostly run on Linux; the kernel is the shared substrate 很多台灣 TEAM 其實已經在用了 只是不知道而已——Cilium/eBPF 早就在底下悄悄跑 GKE Dataplane V2 · 預設(Autopilot) AWS EKS Anywhere · 預設 Sources: GKE Dataplane V2 docs (default for new Autopilot clusters; built on Cilium) · EKS Anywhere CNI docs (Cilium is the default)
  8. Why people use eBPF 為什麼大家要用 eBPF? CLOUDFLARE DATADOG META 3.8

    Tbps −35% CPU −20% CPU 改用 eBPF 追蹤連線,CPU 用量降 eBPF profiler(Strobelight)找出 35% 浪費,CPU 週期最多省 20% Cut CPU usage 35% with an eBPF connection tracker eBPF profiler cut CPU cycles by up to 20% 用 XDP/eBPF 在網卡層丟掉 DDoS 封 包,自動擋下攻擊(2024) Dropped DDoS packets at the NIC with XDP/eBPF, auto-mitigated (2024) Sources: Cloudflare blog (2024-10-02) · Datadog case study · Meta case study (eBPF Foundation)
  9. Networking Security Cilium Tetragon · Falco · KubeArmor Observability Tracing

    Inspektor Gadget · Pixie bcc / libbpf-tools · bpftrace
  10. 持續監測 Parca Pyroscope Grafana Beyla Elastic 把自己的 eBPF profiling agent

    捐給 OpenTelemetry,現在叫 opentelemetry-ebpf-profiler 第四個 telemetry signal logs · metrics · traces · profiles OTel Profiles 進 public alpha,2026 年 3 月 Source: OpenTelemetry blog, “OpenTelemetry Profiles Enters Public Alpha” (2026-03-26)
  11. INTEL AI Flame Graphs / iaprof Brendan Gregg 做的——對,就是寫 BPF

    Performance Tools 那位——用 eBPF + 硬體 sampling 剖析 GPU ISOVALENT META shirudo BpfJailer BPF live-patching:不用等 kernel 更 用 eBPF 實作 MAC,把不受信任的 AI 新、重開機,用 BPF 即時緩解漏洞; training/inference workload 關進 patch 由 agent 跟 operator 一起寫; sandbox。LPC 2025 發表,已有實驗性 signed BPF + BPF LSM 防止 root 竄改 開源版本 BPF live-patching infra for the agentic era · LPC 2026 eBPF-based MAC sandboxing for untrusted AI workloads workload,Apache 2.0 開源 Built by the author of BPF Performance Tools Sources: Phoronix, iaprof open-sourced (2025-04-30) · shirudo, LPC 2026 · BpfJailer, LPC 2025
  12. eBPF itself is changing eBPF 本身也在變 目標:rustc 接受的,verifier 就接受 為什麼

    2026 已合併 進行中 Agent 寫 eBPF 常常直接放棄; 讓 Rust 編出來的程式能載入:更多參 迴圈 widening,拿掉 100 萬指令上 verifier 錯誤訊息很難讀 數、16 層函式呼叫、2 KiB stack 限 LLMs give up on BPF; verifier errors are hard to read So Rust programs load: more args, 16level calls, 2 KiB stack Loop widening, no more 1M-instruction limit Sources: Alexei Starovoitov · LSFMM+BPF 2026 (LWN, “BPF in the agentic era”) · LPC 2026 “Rust-BPF updates”
  13. 走出 Linux Beyond Linux eBPF 的概念已經擴散到 Linux 以外 eBPF for

    Windows Solana IETF RFC 9669 已經過了 1.0,目前到 v1.7.0 鏈上程式跑在 eBPF 衍生的 VM 上 BPF 指令集(ISA)正式標準化 Sources: eBPF for Windows v1.7.0 (pre-release) · Solana docs, program execution · RFC 9669 (2024)
  14. Organizations eBPF Foundation Meta Isovalent eBPF Steering Committee (BSC) 創造者暨核心維護者

    · creators + lead maintainers Alexei Starovoitov Daniel Borkmann 2013 2014 2021 2021 提出 eBPF 進主線 基金會成立 BSC 成立 紀錄片 eBPF: Unlocking the Kernel(2023)→ 海報:Speakeasy Productions Source: eBPF Foundation announcement (2021-08)
  15. 活動 Events, international → local 國際/線上 Online Kernel 開發者 eBPF

    Summit 2027: Security Edition FOSDEM 2027 eBPF devroom 2027/1/27 · 線上 2027/1/30 · Brussels · CfP 11/23 截止 bpftrace office hours + Discord BPF office hours 每月一次 · 詳見 GitHub README 不定期 · 寄信到 bpf mailing list Linux Plumbers Conference · LSF/MM/BPF APAC Cilium APAC community call — 每月第三個星期三,台北時間 12:30 在地 Local COSCUP More events: ebpf.io/events 今天這場 meetup eBPF Japan Meetup
  16. 從哪裡開始 《Learning eBPF》 ebpf.io eBPF Documentary Liz Rice 寫的 入口

    剛剛提到的紀錄片 ebpf.io 已經有繁體中文版,可以看看能不能幫忙翻譯
  17. 謝謝 特別感謝 Takeru Hayasaka(@takemioIO) 提供講題建議,還有 eBPF Japan 貼紙 Thank you

    Shung-Hsi Yu · SUSE Cloud Native Taiwan User Group · eBPF Foundation