[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: fix potential overflow in multifd se
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH] migration: fix potential overflow in multifd send |
Date: |
Fri, 20 Jul 2018 10:37:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Peter Xu <address@hidden> wrote:
> I would guess it won't happen normally, but this should ease Coverity.
>
>>>> CID 1394385: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
>>>> Potentially overflowing expression "pages->used * 8192U" with
>>>> type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit
>>>> arithmetic, and then used in a context that expects an expression
>>>> of type "uint64_t" (64 bits, unsigned).
> 854 transferred = pages->used * TARGET_PAGE_SIZE + p->packet_len;
>
> Fixes: CID 1394385
> CC: Juan Quintela <address@hidden>
> Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
a - I hate C promotion rules
b - why gcc don't warn me
c - it don't matter. If the size of the package is bigger than 4GB, we
have other problems already.
Thanks, Juan.