From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akWmO-00057s-DV for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akWmK-0001y5-Gy for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:00:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akWmK-0001xM-4f for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:00:20 -0400 References: <1459161798-32120-1-git-send-email-den@openvz.org> <1459161798-32120-2-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <56F92AE1.2040709@redhat.com> Date: Mon, 28 Mar 2016 07:00:17 -0600 MIME-Version: 1.0 In-Reply-To: <1459161798-32120-2-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SqpV8rTkXJAnbKfxfNUCwRNhhaH5GujR0" Subject: Re: [Qemu-devel] [PATCH 1/3] NBD proto: forbid TRIM command without negotiation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org Cc: Wouter Verhelst , Pavel Borzenkov , Alex Bligh This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SqpV8rTkXJAnbKfxfNUCwRNhhaH5GujR0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/28/2016 04:43 AM, Denis V. Lunev wrote: > From: Pavel Borzenkov >=20 > There is a loophole in the protocol that allows a client to send TRIM > request even if support for it wasn't negotiated with the server. State= > explicitly that the client MUST NOT send such command without prior > successful negotiation. >=20 > Signed-off-by: Pavel Borzenkov > Reviewed-by: Roman Kagan > Signed-off-by: Denis V. Lunev > CC: Wouter Verhelst > CC: Eric Blake > CC: Alex Bligh > --- > doc/proto.md | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/doc/proto.md b/doc/proto.md > index 6d1cb34..d54ed19 100644 > --- a/doc/proto.md > +++ b/doc/proto.md > @@ -471,6 +471,9 @@ The following request types exist: > about the contents of the export affected by this command, until > overwriting it again with `NBD_CMD_WRITE`. > =20 > + A client MUST NOT send a trim request unless `NBD_FLAG_SEND_TRIM` > + was set in the export flags field. > + Do we also want to mention that the server SHOULD fail with EINVAL if the client sends it anyway, and similarly if NBD_CMD_FLUSH was sent without the appropriate export flag (but that the client should not rely on that particular failure)? But as this is a strict improvement, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SqpV8rTkXJAnbKfxfNUCwRNhhaH5GujR0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW+SrhAAoJEKeha0olJ0NqtDIIAJZjD4hIPAn/g+nuE9KPQT5n J9meHHquxwJBu6HMQwV1JQWbWMGx2DPjenEo4Da/PosEwellYjUoHz0IeSlbFGnb ZYNXrpqGZjcxuiTdN4pp//KaaswCCA3fi7Ya+AGmx/NB5Yp/+vaNkuXQCpX47350 TxeMzrGsVnAO3OdTiZ/Qt3ERiXebwm27BZrid66TNhyvYTTap12MSD0BZ1CIV3ZS 5Z1V+5Fcz8rQE8BCyiF8xxBCfA10NyAnLlEeTj8dv6kecBVKMefk1lTmwHbo2vLE 3vctKFfRED7IZaRVwP/32BJLk/cNPFedMwRbZPlNhj4+qoEakJA7YSKUxE4Vut0= =kZIw -----END PGP SIGNATURE----- --SqpV8rTkXJAnbKfxfNUCwRNhhaH5GujR0--