Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5c702d3 authored by Jan Beulich's avatar Jan Beulich Committed by Konrad Rzeszutek Wilk
Browse files

Xen: properly bound buffer access when parsing cpu/*/availability



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

Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent d0b4d64a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@ static void disable_hotplug_cpu(int cpu)
static int vcpu_online(unsigned int cpu)
{
	int err;
	char dir[32], state[32];
	char dir[16], state[16];

	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) {
		if (!xen_initial_domain())
			printk(KERN_ERR "XENBUS: Unable to read cpu state\n");