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

[Xen-changelog] [linux-2.6.18-xen] xenbus: fix overflow check in xenbus_dev_write()


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Wed, 17 Oct 2012 09:11:03 +0000
  • Delivery-date: Wed, 17 Oct 2012 09:11:14 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1350463306 -7200
# Node ID 9db2ee23611eb88e3f29fc177ded2fca2bcb89b9
# Parent  480fbb0fc4b54af94c5682fadb737c9df8af57ef
xenbus: fix overflow check in xenbus_dev_write()

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 480fbb0fc4b5 -r 9db2ee23611e drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Thu Oct 04 11:13:04 2012 +0200
+++ b/drivers/xen/xenbus/xenbus_dev.c   Wed Oct 17 10:41:46 2012 +0200
@@ -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;
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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