qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Ari Sundholm <ari@tuxera.com>
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	"open list:blklogwrites" <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] block/blklogwrites: Make sure the log sector size is not too small
Date: Tue, 10 Jul 2018 13:19:34 +0200	[thread overview]
Message-ID: <20180710111934.GE5852@localhost.localdomain> (raw)
In-Reply-To: <bc67dd6e-6e55-4201-43cc-da3b5b20d4dd@tuxera.com>

Am 09.07.2018 um 17:01 hat Ari Sundholm geschrieben:
> Would there be a chance of getting this included in 3.0?

Sure, this is clearly a bug fix.

Thanks, applied to the block branch.

Kevin

> On 07/06/2018 03:00 PM, Ari Sundholm wrote:
> > The sector size needs to be large enough to accommodate the data
> > structures for the log super block and log write entries. This was
> > previously not properly checked, which made it possible to cause
> > QEMU to badly misbehave.
> > 
> > Signed-off-by: Ari Sundholm <ari@tuxera.com>
> > ---
> >   block/blklogwrites.c | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/block/blklogwrites.c b/block/blklogwrites.c
> > index 63bf6b3..efa2c7a 100644
> > --- a/block/blklogwrites.c
> > +++ b/block/blklogwrites.c
> > @@ -89,7 +89,10 @@ static inline uint32_t blk_log_writes_log2(uint32_t value)
> >   static inline bool blk_log_writes_sector_size_valid(uint32_t sector_size)
> >   {
> > -    return sector_size < (1ull << 24) && is_power_of_2(sector_size);
> > +    return is_power_of_2(sector_size) &&
> > +        sector_size >= sizeof(struct log_write_super) &&
> > +        sector_size >= sizeof(struct log_write_entry) &&
> > +        sector_size < (1ull << 24);
> >   }
> >   static uint64_t blk_log_writes_find_cur_log_sector(BdrvChild *log,
> > 
> 

      reply	other threads:[~2018-07-10 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 12:00 [Qemu-devel] [PATCH] block/blklogwrites: Make sure the log sector size is not too small Ari Sundholm
2018-07-09 15:01 ` Ari Sundholm
2018-07-10 11:19   ` Kevin Wolf [this message]

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=20180710111934.GE5852@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=ari@tuxera.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).