On Fri, 8 Oct 2021 14:49:55 +0200 Lorenzo Bianconi wrote: > +BPF_CALL_4(bpf_xdp_load_bytes, struct xdp_buff *, xdp, u32, offset, > + void *, buf, u32, len) > +{ > + void *ptr; > + > + if (!buf) > + return -EINVAL; Can we make the verifier ensure it's not NULL? > + ptr = bpf_xdp_pointer(xdp, offset, len, buf); > + if (ptr != buf) > + memcpy(buf, ptr, len); Don't we need to return an error in case offset + length > frame size? > + return 0; > +}