[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 6/6] xen-netback: don't disconnect frontend when seeing oversize frame



On Mon, Mar 25, 2013 at 12:53:57PM +0000, Jan Beulich wrote:
> >>> On 25.03.13 at 12:08, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> > @@ -947,10 +949,21 @@ static int netbk_count_requests(struct xenvif *vif,
> >  
> >             memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + slots),
> >                    sizeof(*txp));
> > -           if (txp->size > first->size) {
> > -                   netdev_err(vif->dev, "Packet is bigger than frame.\n");
> > -                   netbk_fatal_tx_err(vif);
> > -                   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 && txp->size > first->size) {
> > +                   if (net_ratelimit())
> > +                           netdev_dbg(vif->dev,
> > +                                      "Packet is bigger than frame.\n");
> > +                   drop = true;
> 
> So this deals with one half of the problem, but shouldn't we also
> revert the disconnect when slots would exceed MAX_SKB_FRAGS
> (or max_skb_slots after patch 5)? Afaict you could trivially extend
> this patch to also cover that case...
> 

I don't think we should do that. IMO a guest using too many slots should
be considered malicious and disconnected.


Wei.

> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.