Commit Graph

16 Commits (27d803b634d3f540fa36163c6f6eb146ffdb7e27)

Author SHA1 Message Date
William Findlay 6539cbb555
aya/aya-bpf: implement btf tracepoint programs 3 years ago
William Findlay 169478c863 Add support for raw tracepoint and LSM programs
This change adds support for the following program types:

* raw tracepoint
* LSM

Supporting LSM programs involved a necessity of supporting more
load_attrs for the BPF_PROG_LOAD operation, concretely:

* expected_attach_type - for LSM programs, it has always to be set to
  BPF_LSM_MAC
* attach_btf_obj_fd - it's often used to reference the file descriptor of
  program's BTF info, altough in case of LSM programs, it only has to
  contain the value 0, which means the vmlinux object file (usually
  /sys/kernel/btf/vmlinux)
* attach_btf_id - ID of the BTF object, which in case of LSM programs is
  the ID of the function (the LSM hook)

The example of LSM program using that functionality can be found here:

https://github.com/vadorovsky/aya-example-lsm

Fixes: #9
Signed-off-by: William Findlay <william@williamfindlay.com>
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Markus Stange c39dff6025 Add support for PerfEvent programs. 3 years ago
Alessandro Decina a68ff47246 aya-bpf, aya-bpf-bindings: fix clippy lints 4 years ago
Tw 55ba0538f2
bpf: add support for tracepoint program (#29)
This patch add initial support for tracepoint program type.
Hope you enjoy.

Signed-off-by: Tw <wei.tan@intel.com>
4 years ago
Alessandro Decina 5dfd27dbd0 bpf: fix some clippy warnings 4 years ago
Alessandro Decina ef39e0ebd2 bpf: sk_skb: add ::cb() and ::cb_mut() to work with skb->cb 4 years ago
Alessandro Decina ec5822d78e bpf: sk_skb: wrap more helpers 4 years ago
Alessandro Decina 73c48a5029 bpf: add support for BPF_PROG_TYPE_CGROUP_SKB programs
Example:

fn cgroup_skb_egress(skb: SkSkbContext) -> i32 {
    // allow data to go through
    1
}
4 years ago
Alessandro Decina 97c96383bd bpf: improve SockOpsContext API 4 years ago
Alessandro Decina cb3d71429c bpf: improve SkMsgContext API 4 years ago
Alessandro Decina 8f55cd728c bpf: SkSkbContext: add ::l3_csum_replace 4 years ago
Alessandro Decina 8e6f447e9b bpf: sk_skb: add helper methods
This adds support for skb_store_bytes, skb_load_bytes and
l4_csum_replace to SkSkbContext.
4 years ago
Alessandro Decina e11edc072b bpf: add more bindings
Initial support for Array, HashMap and SockHash maps, and for SkSkb,
SkMsg, SockOps and XDP programs.
4 years ago
Alessandro Decina 7815711196 bpf: add aya-bpf-bindings
Move the generated bindings to aya-bpf-bindings.
4 years ago
Alessandro Decina cdf960aaa1 bpf: initial bpf bindings 4 years ago