Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369368
b: refs/heads/master
c: 03393fd
h: refs/heads/master
v: v3
  • Loading branch information
Wei Liu authored and David S. Miller committed Apr 22, 2013
1 parent 5cc3ebd commit 1ecd170
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2810e5b9a7731ca5fce22bfbe12c96e16ac44b6f
refs/heads/master: 03393fd5cc2b6cdeec32b704ecba64dbb0feae3c
22 changes: 16 additions & 6 deletions trunk/drivers/net/xen-netback/netback.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,12 +975,22 @@ 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,
"Invalid tx request, slot size %u > remaining size %u\n",
txp->size, first->size);
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_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;
Expand Down

0 comments on commit 1ecd170

Please sign in to comment.