Re: [Qemu-devel] [PATCH] vl.c: Check -smp option ranges before setting int globals

2014-06-06 Thread Eduardo Habkost
On Fri, Jun 06, 2014 at 08:06:52AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > When parsing the -smp option, check if the values (that can be anywhere > > in the [0, UINT64_MAX] range) are in the int range before setting the > > int globals smp_cpus, max_cpus, smp_cores, smp_t

Re: [Qemu-devel] [PATCH] vl.c: Check -smp option ranges before setting int globals

2014-06-05 Thread Markus Armbruster
Eduardo Habkost writes: > When parsing the -smp option, check if the values (that can be anywhere > in the [0, UINT64_MAX] range) are in the int range before setting the > int globals smp_cpus, max_cpus, smp_cores, smp_threads. > > Without this, it was posbible to make smp_cpus and max_cpus negat

[Qemu-devel] [PATCH] vl.c: Check -smp option ranges before setting int globals

2014-06-05 Thread Eduardo Habkost
When parsing the -smp option, check if the values (that can be anywhere in the [0, UINT64_MAX] range) are in the int range before setting the int globals smp_cpus, max_cpus, smp_cores, smp_threads. Without this, it was posbible to make smp_cpus and max_cpus negative. Signed-off-by: Eduardo Habkos