Commit Graph

9 Commits (239acac2c527828b312304810a9216bfba794496)

Author SHA1 Message Date
Thomas Eizinger 239acac2c5
workspace: include eBPF crates in default-members
Being able to compile the eBPF crates for the host architecture is
useful because it allows `cargo build` and `cargo test` to "just work".

To achieve that, we feature-gate `no_std` and `no_main` on the bpf
target architecture.
4 weeks ago
Thomas Eizinger 5757a96353
aya-ebpf: introduce `panic_handler` macro
All eBPF crates need to define a panic-handler.
To deduplicate that code, we introduce a macro for it.
4 weeks ago
Tamir Duberstein f0a9f19ddc Bump edition to 2024
Change FromRawTracepointArgs::arg to return T rather than *const T which
seems to have been returning a dangling pointer.

Arguably this is not strictly necessary; edition 2024 seems to be
focused on increased strictness around unsafe code which doesn't unlock
new functionality for our users. That said, this work revealed an
apparent bug (see above) that we wouldn't otherwise catch due to
allow-by-default lints.
2 months ago
Tamir Duberstein e0c4948e36 Extract integration-common for shared types 5 months ago
Dave Tucker 41c61560ea chore(aya-ebpf): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Tamir Duberstein ad460879ef
integration-test: replace macro with function
There's just no need for a macro here.
2 years ago
Tamir Duberstein 8cee3f8b01
integration-test: distinguish between success and noop
These tests previously produced the same result on certain failures as
they did on success.
2 years ago
Tamir Duberstein e621a09181
Clippy over tests and integration-ebpf
Replace all `assert!(matches!(..))` with `assert_matches!(..)`.

Remove the now-unused build-integration-test xtask command whose logic
doesn't match that of the build-and-run command.
2 years ago
Alessandro Decina 11c227743d bpf: improve bpf_probe_read_kernel_str_bytes and bpf_probe_read_user_str_bytes
This change does a few things:

- it fixes a bug in the wrappers, where we were expecting the kernel to
  return len=1 for b"\0" where it instead returns 0 and doesn't write
  out the NULL terminator

- it makes the helpers more robust by hardcoding bound checks in
  assembly so that LLVM optimizations can't transform the checks in a
  way that the verifier can't understand.

- it adds integration tests
2 years ago