Commit f1369580 authored by Wei Liu's avatar Wei Liu Committed by Greg Kroah-Hartman

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

commit 03393fd5 upstream.

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
packet.

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 <david.vrabel@citrix.com>
Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9832f4a0
...@@ -947,12 +947,22 @@ static int netbk_count_requests(struct xenvif *vif, ...@@ -947,12 +947,22 @@ static int netbk_count_requests(struct xenvif *vif,
memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + slots), memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + slots),
sizeof(*txp)); sizeof(*txp));
if (txp->size > first->size) {
netdev_err(vif->dev, /* If the guest submitted a frame >= 64 KiB then
"Invalid tx request, slot size %u > remaining size %u\n", * first->size overflowed and following slots will
txp->size, first->size); * appear to be larger than the frame.
netbk_fatal_tx_err(vif); *
return -EIO; * 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())
netdev_dbg(vif->dev,
"Invalid tx request, slot size %u > remaining size %u\n",
txp->size, first->size);
drop_err = -EIO;
} }
first->size -= txp->size; 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