Snapshot of iovisor/ubpf: 997★, C. Userspace eBPF VM
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This project aims to create an Apache-licensed library for executing eBPF programs. The primary implementation of eBPF lives in the Linux kernel, but due to its GPL license it can't be used in many projects.
BPF Instruction Set Architecture (ISA) - RFC 9669
Linux documentation for the eBPF instruction set
Instruction set reference
API Documentation
This project includes an eBPF assembler, disassembler, interpreter (for all platforms),
and JIT compiler (for x86-64 and Arm64 targets).
Safe Execution Profile
uBPF now supports two execution profiles:
Legacy — the default profile. This preserves the existing interpreter/JIT behavior and compatibility surface.
Safe — an explicit, interpreter-only profile that adds register provenance tracking, centralized checked dereferences, typed helper metadata, and descriptor-backed external regions.
The safe profile is meant for embedders that want stronger runtime safety guarantees without relying solely on an external verifier. In safe mode:
only pointer-classified registers may be dereferenced
each pointer carries one specific region identity, bounds, and permissions
ambiguous pointer arithmetic is rejected instead of being recovered later by range scanning
helper calls that return pointers or handles must be registered with safe metadata
JIT compilation is intentionally unavailable in the first revision
Select the profile before loading code:
struct ubpf_vm* vm = ubpf_create();
ubpf_set_execution_profile(vm, UBPF_EXECUTION_PROFILE_SAFE);
If the program uses helpers that return pointers or opaque handles, register them with
ubpf_register_safe_helper(). If the program needs additional dereferenceable regions
beyond the input buffer and stack, register them with ubpf_register_safe_region().
Using Verified Programs
If you're using external eBPF verifiers like PREVAIL with uBPF, please read Using Verified eBPF Programs with uBPF for important information about context pointer requirements and how to avoid runtime crashes.
Checking Out
Before following any of the instructions below for building,
testing, contributing, etc, please be
sure to properly check out the source code which requires properly initializing submodules:
git submodule update --init --recursive
Preparing system for build
In order to prepare your system to successfully generate the build system using CMake, follow the platform-specific instructions below.
Windows
Building, compiling and testing on Windows requires an installation of Visual Studio (not VS Code -- the MSVC compiler is necessary!).
Note: There are free-to-use versions of Visual Studio for individual developers. These versions are known as the community version.
You can build, compile and test uBPF using VS Code but Visual Studio is still required.
The other requirement is that you have nuget.exe in your PATH. You can determine if your host meets this criteria by testing whether
> nuget.exe
produces output about how to execute the program. With nuget.exe installed, the cmake configuration system will download all the required developer libraries as it configures the build system.
macOS
First, make sure that you have the XCode Command Line Tools installed:
$ xcode-select --install
Installing the XCode Command Line Tools will install Apple's version of the Clang compiler and other developer-support tools.
uBpf requires that your host have several support libraries installed. The easiest way to configure your host to meet these requirements,
Installing LLVM from Homebrew is optional for developing and using uBPF on macOS. It is required if you plan on compiling/creating eBPF programs by compiling LLVM and storing them in ELF files. If you do install LLVM from Homebrew, add -DUBPF_ALTERNATE_LLVM_PATH=/opt/homebrew/opt/llvm/bin to the cmake configuration command:
all-testing: Build configuration for both tests and fuzzing (Linux/macOS only)
cmake --preset all-testing
cmake --build build
To list all available presets:
cmake --list-presets
Running the tests
Linux and MacOS
cmake --build build --target test --
Windows
ctest --test-dir build
Contributing
We love contributions!
Preparing Code Contributions
We aim to maintain code coverage with every code change. The CI/CD pipeline will verify this invariant as part of the contribution process. However, you can calculate code coverage locally by
We also aim to maintain a consistent code format. The pre-commit git hooks configured for the uBPF repository will guarantee that code changes match the format we expect. In order for those hooks to work effectively, you must have clang-format installed and available on your system.
Compiling C to eBPF
You'll need Clang 3.7.
clang-3.7 -O2 -target bpf -c prog.c -o prog.o
You can then pass the contents of prog.o to ubpf_load_elf, or to the stdin of
the vm/test binary.
License
Copyright 2015, Big Switch Networks, Inc. Licensed under the Apache License, Version 2.0
<LICENSE.txt or http://www.apache.org/licenses/LICENSE-2.0>.
TopGit's last sync did not record any GitHub topics for iovisor/ubpf. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on iovisor/ubpf?
The most recent commit recorded on iovisor/ubpf was today, based on the GitHub push timestamp. The repository has 166 forks — one of the better signals of community interest.
How many stars does iovisor/ubpf have?
iovisor/ubpf has 997 GitHub stars — refresh the page for the live number, or check github.com/iovisor/ubpf. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is iovisor/ubpf written in?
iovisor/ubpf is written primarily in C. GitHub's language field is based on the largest share of bytes in the default branch.
Where do I read more about iovisor/ubpf?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/iovisor/ubpf is the definitive source.
Read full README in the tab above.
Still deciding about ubpf?
One click hands the question to an AI along with this page — see what it says about ubpf.