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

David Miller
2020-04-08T21:49:17Z

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.