All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: Tuguoyi <tu.guoyi@h3c.com>,
	"kwolf\@redhat.com" <kwolf@redhat.com>,
	"mreitz\@redhat.com" <mreitz@redhat.com>,
	"qemu-block\@nongnu.org" <qemu-block@nongnu.org>
Cc: Chengchiwen <chengchiwen@h3c.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Gaoliang <liang_gao@h3c.com>
Subject: Re: [PATCH] qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
Date: Wed, 05 Aug 2020 15:45:05 +0200	[thread overview]
Message-ID: <w51ft91b40u.fsf@maestria.local.igalia.com> (raw)
In-Reply-To: <w51imdxb42f.fsf@maestria.local.igalia.com>

On Wed 05 Aug 2020 03:44:08 PM CEST, Alberto Garcia wrote:
> On Wed 05 Aug 2020 11:22:58 AM CEST, Tuguoyi wrote:
>> This patch fix it by casting @i to uint64_t before doing left shift
>> operation
>
> The patch seems fine and I also think that it's perhaps worth a test
> case (although it only seems to happen with preallocation=falloc or full
> so the test would need to generate very large files).
>
> But I also wonder if there are other cases where this can happen.
>
> nb_clusters is an int and there are more cases of
>
>     nb_clusters << s->cluster_bits
>
> I can see at least these: handle_alloc(), qcow2_free_any_clusters(),
> qcow2_alloc_cluster_abort().

I forgot to add

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto


  reply	other threads:[~2020-08-05 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  9:22 [PATCH] qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2() Tuguoyi
2020-08-05 13:33 ` [PATCH for-5.1?] " Eric Blake
2020-08-05 13:39 ` [PATCH] " Kevin Wolf
2020-08-05 13:44 ` Alberto Garcia
2020-08-05 13:45   ` Alberto Garcia [this message]
2020-08-05 14:16   ` Kevin Wolf
2020-08-05 14:32     ` Alberto Garcia
2020-08-05 15:21 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=w51ft91b40u.fsf@maestria.local.igalia.com \
    --to=berto@igalia.com \
    --cc=chengchiwen@h3c.com \
    --cc=kwolf@redhat.com \
    --cc=liang_gao@h3c.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tu.guoyi@h3c.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.