commit | 089f6279752adfb01386600d119913403ed326ee | [log] [tgz] |
---|---|---|
author | Oleg Pigal <olegpi@google.com> | Tue Apr 21 19:46:52 2020 -0400 |
committer | Paul Chaignon <paul.chaignon@gmail.com> | Wed Apr 29 08:57:36 2020 +0200 |
tree | b962c03f1533521d7535d18a0474c9c2c5ba99ef | |
parent | 4cbf7998e6f72f3f4d0b30cf30cb508428eb421f [diff] |
Introduce toggle to enable/disable bounds_check. bounds_check routine assumes that memory to read / write may only be on the stack or within ubpf code itself. The toggle allows disabling the check when the assumption is not correct.
Userspace eBPF VM
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.
Linux documentation for the eBPF instruction set
This project includes an eBPF assembler, disassembler, interpreter, and JIT compiler for x86-64.
Run make -C vm
to build the VM. This produces a static library libubpf.a
and a simple executable used by the testsuite. After building the library you can install using make -C vm install
via either root or sudo.
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.
Please fork the project on GitHub and open a pull request. You can run all the tests with nosetests
.
Copyright 2015, Big Switch Networks, Inc. Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0>.