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

[Xen-devel] [PATCH] linux-2.6.18/xenbus: fix overflow check in xenbus_dev_write()


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Tue, 16 Oct 2012 13:18:52 +0100
  • Delivery-date: Tue, 16 Oct 2012 12:19:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/drivers/xen/xenbus/xenbus_dev.c
+++ b/drivers/xen/xenbus/xenbus_dev.c
@@ -239,7 +239,7 @@ static ssize_t xenbus_dev_write(struct f
        if (!is_xenstored_ready())
                return -ENODEV;
 
-       if ((len + u->len) > sizeof(u->u.buffer)) {
+       if (len > sizeof(u->u.buffer) - u->len) {
                rc = -EINVAL;
                goto out;
        }



Attachment: xen-xenbus-dev-write-buflen.patch
Description: Text document

_______________________________________________
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®.