mirror of https://github.com/aya-rs/aya
fix(aya-ebpf): Add bounds check to SkBuff::load_bytes
This resolves the verifier error triggered by the test case added in the previous commitreviewable/pr1218/r5
parent
25aa5ebcf2
commit
0b3c37bf73
@ -1,13 +1,8 @@
|
|||||||
use aya::{programs::SocketFilter, Ebpf};
|
use aya::{Ebpf, programs::SocketFilter};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn socket_filter_load() {
|
fn socket_filter_load() {
|
||||||
let mut bpf = Ebpf::load(crate::SOCKET_FILTER).unwrap();
|
let mut bpf = Ebpf::load(crate::SOCKET_FILTER).unwrap();
|
||||||
let prog: &mut SocketFilter = bpf
|
let prog: &mut SocketFilter = bpf.program_mut("read_one").unwrap().try_into().unwrap();
|
||||||
.program_mut("read_one")
|
|
||||||
.unwrap()
|
|
||||||
.try_into()
|
|
||||||
.unwrap();
|
|
||||||
prog.load().unwrap();
|
prog.load().unwrap();
|
||||||
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue