All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts
@ 2015-12-01 14:23 Kevin Wolf
  2015-12-01 14:25 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2015-12-01 14:23 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mst, qemu-devel, mreitz

This crash was caught with qemu-iotests test case 138.

Commit b6d36de already fixed a few 32 bit truncation bugs that could
cause qemu-img check to allocate too little memory and consequently
it would segfault. On 32 bit hosts, there is one more place that needs
to be fixed because size_t was involved in the calculation and is a
32 bit type there.

Cc: qemu-stable@nongnu.org
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2-refcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 6e0e5bd..820f412 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1244,7 +1244,7 @@ fail:
 /* refcount checking functions */
 
 
-static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
+static uint64_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
 {
     /* This assertion holds because there is no way we can address more than
      * 2^(64 - 9) clusters at once (with cluster size 512 = 2^9, and because
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts
  2015-12-01 14:23 [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts Kevin Wolf
@ 2015-12-01 14:25 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2015-12-01 14:25 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block, mreitz

On Tue, Dec 01, 2015 at 03:23:45PM +0100, Kevin Wolf wrote:
> This crash was caught with qemu-iotests test case 138.
> 
> Commit b6d36de already fixed a few 32 bit truncation bugs that could
> cause qemu-img check to allocate too little memory and consequently
> it would segfault. On 32 bit hosts, there is one more place that needs
> to be fixed because size_t was involved in the calculation and is a
> 32 bit type there.
> 
> Cc: qemu-stable@nongnu.org
> Reported-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  block/qcow2-refcount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index 6e0e5bd..820f412 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -1244,7 +1244,7 @@ fail:
>  /* refcount checking functions */
>  
>  
> -static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
> +static uint64_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
>  {
>      /* This assertion holds because there is no way we can address more than
>       * 2^(64 - 9) clusters at once (with cluster size 512 = 2^9, and because
> -- 
> 1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-01 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 14:23 [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts Kevin Wolf
2015-12-01 14:25 ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.