All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/4] block: Correct bs->growable
Date: Wed, 20 Aug 2014 13:40:59 +0200	[thread overview]
Message-ID: <20140820114059.GF6122@noname.redhat.com> (raw)
In-Reply-To: <1405117387-25539-2-git-send-email-mreitz@redhat.com>

Am 12.07.2014 um 00:23 hat Max Reitz geschrieben:
> Currently, the field "growable" in a BDS is set iff the BDS is opened in
> protocol mode (with O_BDRV_PROTOCOL). However, not every protocol block
> driver allows growing: NBD, for instance, does not. On the other hand,
> a non-protocol block driver may allow growing: The raw driver does.
> 
> Fix this by correcting the "growable" field in the driver-specific open
> function for the BDS, if necessary.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>

I'm not sure I agree with bs->growable = true for raw. It's certainly
true that the backend can technically provide the functionality that
writes beyond EOF grow the file. That's not the point of bs->growable,
though.

The point of it was to _forbid_ it to grow even when it's technically
possible (non-file protocols weren't really a thing back then, apart
from vvfat, so the assumption was that it's always technically
possible). growable was introduced with bdrv_check_request(), which is
supposed to reject guest requests after the end of the virtual disk (and
this fixed a CVE, see commit 71d0770c). You're now disabling this check
for raw.

I think we need to make sure that bs->growable is only set if it is
opened for an image that has drv->requires_growing_file set and
therefore not directly used by a guest.

Well, except that with node-name a guest will be able to use any image
in the chain... Might this mean that it's really a BlockBackend
property?

Kevin

  reply	other threads:[~2014-08-20 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 22:23 [Qemu-devel] [PATCH 0/4] block: Warn about usage of growing formats over non-growable protocols Max Reitz
2014-07-11 22:23 ` [Qemu-devel] [PATCH 1/4] block: Correct bs->growable Max Reitz
2014-08-20 11:40   ` Kevin Wolf [this message]
2014-08-20 19:13     ` Max Reitz
2014-08-21  8:19       ` Kevin Wolf
2014-08-22 13:26         ` Max Reitz
2014-09-04 20:01     ` Max Reitz
2014-09-05 10:01       ` Kevin Wolf
2014-09-05 12:46         ` Max Reitz
2014-09-05 13:13           ` Kevin Wolf
2014-07-11 22:23 ` [Qemu-devel] [PATCH 2/4] block: Introduce requires_growing_file Max Reitz
2014-07-11 22:23 ` [Qemu-devel] [PATCH 3/4] iotests: Make some qemu-io commands read-only Max Reitz
2014-07-11 22:23 ` [Qemu-devel] [PATCH 4/4] iotests: Skip read and write in 040 for length=0 Max Reitz
2014-08-15 15:23 ` [Qemu-devel] [PATCH 0/4] block: Warn about usage of growing formats over non-growable protocols Max Reitz

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=20140820114059.GF6122@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.