From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH 6/6] xen-netback: don't disconnect frontend when seeing oversize frame Date: Mon, 25 Mar 2013 13:52:03 +0000 Message-ID: <20130325135203.GA3339__35739.589125342$1364219659$gmane$org@zion.uk.xensource.com> References: <1364209702-12437-1-git-send-email-wei.liu2@citrix.com> <1364209702-12437-7-git-send-email-wei.liu2@citrix.com> <515056F502000078000C8184@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <515056F502000078000C8184@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Campbell , "konrad.wilk@oracle.com" , "netdev@vger.kernel.org" , "xen-devel@lists.xen.org" , "annie.li@oracle.com" , David Vrabel List-Id: xen-devel@lists.xenproject.org On Mon, Mar 25, 2013 at 12:53:57PM +0000, Jan Beulich wrote: > >>> On 25.03.13 at 12:08, Wei Liu 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