summaryrefslogtreecommitdiffstats
path: root/net/9p/trans_xen.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/9p/trans_xen.c')
-rw-r--r--net/9p/trans_xen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index ac60ddfcd..6459c2356 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -230,6 +230,14 @@ static void p9_xen_response(struct work_struct *work)
continue;
}
+ if (h.size > req->rc.capacity) {
+ dev_warn(&priv->dev->dev,
+ "requested packet size too big: %d for tag %d with capacity %zd\n",
+ h.size, h.tag, req->rc.capacity);
+ req->status = REQ_STATUS_ERROR;
+ goto recv_error;
+ }
+
memcpy(&req->rc, &h, sizeof(h));
req->rc.offset = 0;
@@ -239,6 +247,7 @@ static void p9_xen_response(struct work_struct *work)
masked_prod, &masked_cons,
XEN_9PFS_RING_SIZE);
+recv_error:
virt_mb();
cons += h.size;
ring->intf->in_cons = cons;