qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH 2/5] nbd/server: add nbd_opt_{read, drop} to track client->optlen
Date: Wed, 22 Nov 2017 13:22:10 -0600	[thread overview]
Message-ID: <2a852369-099f-b93e-9e5f-aae841b6f815@redhat.com> (raw)
In-Reply-To: <20171122101958.17065-3-vsementsov@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

On 11/22/2017 04:19 AM, Vladimir Sementsov-Ogievskiy wrote:
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  nbd/server.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> @@ -299,7 +312,7 @@ static int nbd_negotiate_handle_export_name(NBDClient *client,
>          error_setg(errp, "Bad length received");
>          return -EINVAL;
>      }
> -    if (nbd_read(client->ioc, name, client->optlen, errp) < 0) {
> +    if (nbd_opt_read(client, name, client->optlen, errp) < 0) {
>          error_prepend(errp, "read failed: ");
>          return -EINVAL;
>      }

More context:

      name[client->optlen] = '\0';

Oops - that's broken, because client->optlen is now 0.  Which means your
code was only tested with empty-string default exports.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  parent reply	other threads:[~2017-11-22 19:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 10:19 [Qemu-devel] [PATCH 0/5] NBD server refactoring before BLOCK_STATUS Vladimir Sementsov-Ogievskiy
2017-11-22 10:19 ` [Qemu-devel] [PATCH 1/5] nbd/server: refactor negotiation functions parameters Vladimir Sementsov-Ogievskiy
2017-11-22 16:39   ` Eric Blake
2017-11-22 10:19 ` [Qemu-devel] [PATCH 2/5] nbd/server: add nbd_opt_{read, drop} to track client->optlen Vladimir Sementsov-Ogievskiy
2017-11-22 17:08   ` Eric Blake
2017-11-22 19:22   ` Eric Blake [this message]
2017-11-22 20:03   ` Eric Blake
2017-12-21  1:38     ` Eric Blake
2017-11-22 10:19 ` [Qemu-devel] [PATCH 3/5] nbd/server: add helper nbd_opt_invalid Vladimir Sementsov-Ogievskiy
2017-11-22 21:59   ` Eric Blake
2017-11-22 23:00   ` Eric Blake
2017-11-22 10:19 ` [Qemu-devel] [PATCH 4/5] nbd: rename nbd_option and nbd_opt_reply Vladimir Sementsov-Ogievskiy
2017-11-22 21:56   ` Eric Blake
2018-01-10 18:11     ` Eric Blake
2017-11-22 10:19 ` [Qemu-devel] [PATCH 5/5] nbd/server: structurize option reply sending Vladimir Sementsov-Ogievskiy
2017-11-22 22:02   ` Eric Blake
2018-01-10 18:14     ` Eric Blake
2017-11-22 11:07 ` [Qemu-devel] [PATCH 0/5] NBD server refactoring before BLOCK_STATUS no-reply
2017-11-22 11:54   ` [Qemu-devel] unrelated " Vladimir Sementsov-Ogievskiy

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=2a852369-099f-b93e-9e5f-aae841b6f815@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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 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).