qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/8] vl.c: numa_add(): Validate nodeid before us


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 5/8] vl.c: numa_add(): Validate nodeid before using it
Date: Wed, 16 Jan 2013 10:23:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/16/2013 08:24 AM, Eduardo Habkost wrote:
> Without this check, QEMU will corrupt memory if a too-large nodeid is
> provided in the command-line. e.g.:
> 
>   -numa node,mem=...,cpus=...,nodeid=65
> 
> This changes nodenr to unsigned long long, to avoid integer conversion
> issues when converting the strtoull() result to int.
> 
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> Changes v2:
>  - Implement change without creation of numa_node_add() function

>  
> +        if (nodenr >= MAX_NODES) {
> +            fprintf(stderr, "qemu: invalid NUMA nodeid: %d\n", nodenr);

%lld (I see you later fixed that in 6/8, but you should rebase that hunk
into the patch that first needs it).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]