Commit Graph

5 Commits (b45c3637a53e2a38e29753a36d33e5fe286d3bcc)

Author SHA1 Message Date
Michal R d5e4e9270a aya-ebpf: Remove irrelevant `FIXME` comment
eBPF verifier in recent kernels should be smart enough to track map
map types and catch invalid pointer casts. Rust type system makes sure
that the `get` method can return only the same type the map was created
with. Therefore, safe usage of Aya map types shouldn't cause element
type mismatches.

Manual alignment checks (`pointer::is_aligned` or manual pointer
arithmetic operations) cause the following verifier error:

```
bitwise operator &= on pointer prohibited
```

And it extremely unlikely `bpf_map_lookup_elem` ever returns a
misaligned pointer.
2 days ago
Michal R 3569c9afc3 aya-ebpf: Take `c_void` instead of `bpf_map_def` in map helpers
`bpf_map_def` is a legacy map definition. To be able to introduce BTF
map definitions, make the `lookup` and `remove` helpers work with
`c_void` and let the callers cast the map types to it.
2 days ago
jinlong 2fb19f3ee2 feat: Add `set` for `Array<T>`
Signed-off-by: jinlong <jinlong@tencent.com>
7 months ago
Tamir Duberstein 601c89dd23 aya-ebpf: extract insert,remove,lookup
These functions (and more) are duplicated all over the place.
7 months ago
Dave Tucker 41c61560ea chore(aya-ebpf): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago