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

[Xen-devel] [PATCH] linux-2.6.18: properly bound buffer access when parsing cpu/*/availability


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Tue, 15 Jan 2013 13:29:37 +0000
  • Delivery-date: Tue, 15 Jan 2013 13:29:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

At the same time reduce the local buffers to 16 bytes each.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/drivers/xen/core/cpu_hotplug.c
+++ b/drivers/xen/core/cpu_hotplug.c
@@ -28,13 +28,13 @@ static int local_cpu_hotplug_request(voi
 static void vcpu_hotplug(unsigned int cpu, struct sys_device *dev)
 {
        int err;
-       char dir[32], state[32];
+       char dir[16], state[16];
 
        if ((cpu >= NR_CPUS) || !cpu_possible(cpu))
                return;
 
        sprintf(dir, "cpu/%u", cpu);
-       err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
+       err = xenbus_scanf(XBT_NIL, dir, "availability", "%15s", state);
        if (err != 1) {
                printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
                return;



Attachment: xen-vcpu-availability-field-width.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®.