wasm-bpf/examples/lsm
Officeyutong d3d6c2eb86
Fix conflicts & add go examples & add execve example & fix the callback function signature (#37)
* add lsm go example

* fix: fix some of issues pointed out by deepsource

* add: add go examples & execve & fix callback types in rust runtime

* fix: fix go CI; install tinygo in CI machines

---------

Co-authored-by: dexian <dexian@yunshan.net>
2023-02-22 01:52:58 +08:00
..
Makefile Fix conflicts & add go examples & add execve example & fix the callback function signature (#37) 2023-02-22 01:52:58 +08:00
README.md Fix conflicts & add go examples & add execve example & fix the callback function signature (#37) 2023-02-22 01:52:58 +08:00
libbpf-wasm.h update: re-structured directories & update CI 2023-02-21 09:20:28 +00:00
lsm.bpf.c rename lsm dir 2023-02-06 05:24:14 +08:00
lsm.c support attach to cgroup and add sockops example 2023-02-11 21:35:04 +08:00

README.md

Demo BPF applications

lsm-rmdir

lsm-rmdir hook in dir remove and check the permission to remove a directory. If dir name with can_not_rm will raise Operation not permitted.

We can provide a similar developing experience as the libbpf-bootstrap development. Just run make to build the wasm binary:

make

Note: LSM may failed to load if the kernel is not configured as:

CONFIG_DEBUG_INFO_BTF=y
CONFIG_BPF_LSM=y
CONFIG_LSM="[other LSMs],bpf"

go wasm example(need tinygo):

make lsm_go_wasm # will output to go_wasm/lsm.go.wasm