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.
main
Michal R 4 days ago
parent 3569c9afc3
commit d5e4e9270a

@ -49,7 +49,6 @@ impl<T> Array<T> {
#[inline(always)] #[inline(always)]
pub fn get(&self, index: u32) -> Option<&T> { pub fn get(&self, index: u32) -> Option<&T> {
// FIXME: alignment
unsafe { self.lookup(index).map(|p| p.as_ref()) } unsafe { self.lookup(index).map(|p| p.as_ref()) }
} }

Loading…
Cancel
Save