> 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? I guess we can use ARG_PTR_TO_MEM instead of ARG_PTR_TO_UNINIT_MEM > > > + 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? ack, I will fix it. Regards, Lorenzo > > > + return 0; > > +}
Attachment:
signature.asc
Description: PGP signature