at swithing from no-xdp-attached to xdp-attached, some ring elem
may be added to vring before we attach xdp prog, thoes ring elem
length is variable according to EWMA
while xdp_linearize_page assume ring elem length was aways shorter
then PAGE_SIZE - VIRTIO_XDP_HEADROOM, EWMA may giving a ring elem
bigger then PAGE_SIZE - VIRTIO_XDP_HEADROOM, which make the memory
dirty after the page allocated by xdp_linearize_page
fix it by checking length before really copy, and dropped the current
frame if checking failed, because length of ring elem which is add to
ring buffer after xdp attached is aways shorter
then PAGE_SIZE - VIRTIO_XDP_HEADROOM so here we dropped frame as most
as vring length.
upstream kernel have not repaired this, got it by code review,so, here
repair this by Conservativly dropped frame but not let the system dump
Signed-off-by: mengensun<mengensun@tencent.com>
Reviewed-by: mungerjiang<mungerjiang@tencent.com>
Reviewed-by: imagedong<imagedong@tencent.com>