]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen-netback: stop netif TX queue on guest queuing failure
authorAnkur Arora <ankur.a.arora@oracle.com>
Mon, 22 Jul 2019 23:33:50 +0000 (19:33 -0400)
committerBrian Maly <brian.maly@oracle.com>
Tue, 30 Jul 2019 20:02:54 +0000 (16:02 -0400)
commit9a196f3f92c9506e954a7ca37537c8a8b8faadc1
tree115f85aefb1bb9d748ed99f8cc43b60520cd1682
parentc3a50a915aefc85809cf690e78660f6fe7282b9f
xen-netback: stop netif TX queue on guest queuing failure

On a failure to queue an TX skb to the guest's RX io_ring, we return
NETDEV_TX_BUSY without stopping the netif-queue. If the guest's io_ring
is full, this can lead to unbounded retry.

This fix stops the queue when hit this condition and restarts it once
the guest creates space in its RX io_ring. This also hardens against
malicious guests where the guest netfront can cause DoS on the host by
just not putting responses on the RX io_ring.

The guest can send an rx_interrupt even before the vif is fully
provisioned, so do this only after the vif moves to VIF_STATE_CONNECTED.

Fixes: fb9041f4f7f6 ("xen-netback: copy buffer on xenvif_start_xmit")
(cherry picked from commit c655018645c32745041e5a3d03cbfbf6f0d820ee)

Orabug: 30028200
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/xen-netback/common.h
drivers/net/xen-netback/interface.c
drivers/net/xen-netback/rx.c