Re: [PATCH RFC v2 30/33] xdp: clear grow memory in bpf_xdp_adjust_tail()

Jesper Dangaard Brouer
2020-04-14T09:44:13Z

On Wed, 08 Apr 2020 14:49:14 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Jesper Dangaard Brouer <brouer@redhat.com>
> Date: Wed, 08 Apr 2020 13:53:06 +0200
>
> > @@ -3445,6 +3445,11 @@ BPF_CALL_2(bpf_xdp_adjust_tail, struct xdp_buff *, xdp, int, offset)
> > if (unlikely(data_end < xdp->data + ETH_HLEN))
> > return -EINVAL;
> >
> > + /* Clear memory area on grow, can contain uninit kernel memory */
> > + if (offset > 0) {
> > + memset(xdp->data_end, 0, offset);
> > + }
>
> Single statement basic blocks should elide curly braces.

Fixed

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer