Commit 03393fd5 authored by Wei Liu's avatar Wei Liu Committed by David S. Miller

xen-netback: don't disconnect frontend when seeing oversize packet

Some frontend drivers are sending packets > 64 KiB in length. This length
overflows the length field in the first slot making the following slots have
an invalid length.

Turn this error back into a non-fatal error by dropping the packet. To avoid
having the following slots having fatal errors, consume all slots in the

This does not reopen the security hole in XSA-39 as if the packet as an
invalid number of slots it will still hit fatal error case.
Signed-off-by: default avatarDavid Vrabel <>
Signed-off-by: default avatarWei Liu <>
Acked-by: default avatarIan Campbell <>
Signed-off-by: default avatarDavid S. Miller <>
parent 2810e5b9
......@@ -975,12 +975,22 @@ static int netbk_count_requests(struct xenvif *vif,
memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + slots),
if (txp->size > first->size) {
"Invalid tx request, slot size %u > remaining size %u\n",
txp->size, first->size);
return -EIO;
/* If the guest submitted a frame >= 64 KiB then
* first->size overflowed and following slots will
* appear to be larger than the frame.
* This cannot be fatal error as there are buggy
* frontends that do this.
* Consume all slots and drop the packet.
if (!drop_err && txp->size > first->size) {
if (net_ratelimit())
"Invalid tx request, slot size %u > remaining size %u\n",
txp->size, first->size);
drop_err = -EIO;
first->size -= txp->size;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment