Message ID | 20180723201748.25573-64-mdroth@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B7D4112B for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 21:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 455DD283F1 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 21:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37B10284E9; Mon, 23 Jul 2018 21:13:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCA6C283F1 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 23 Jul 2018 21:13:32 +0000 (UTC) Received: from localhost ([::1]:36678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fhi95-0000kW-Qo for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Jul 2018 17:13:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhK7-0003Kt-AG for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhK6-00051I-9v for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:51 -0400 Received: from mail-oi0-x22b.google.com ([2607:f8b0:4003:c06::22b]:41660) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <flukshun@gmail.com>) id 1fhhK6-000510-4q; Mon, 23 Jul 2018 16:20:50 -0400 Received: by mail-oi0-x22b.google.com with SMTP id k12-v6so3466682oiw.8; Mon, 23 Jul 2018 13:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zfNUWA2FT5JnALSz8JjIUuLr9sPx3kKVNCmRIeDr+04=; b=jwNGbniv3DEBY7SjHp6p1sB+bV0jeq+o0ncdlA+4Av6APxtCEwMXzs8Cmyeqsoaq+i bfZp92Rh40eEQdfwseq/fph7MzS70lRJNIe0Ecl99VGrIf5qQSVYC67KBebGAA84bTyz QJu1OxI7m5IsDhuOrrX8eWs53g6voXx0+oXBiK4Fn7ZaECTHuglWqAJWJ4wn3tDp7rDS GLSchx6H0EtDbUq0veAEhBxAPNFNZC/+v0COzXtZy4Ide8W8GLrPED8CeSdA0I08Ok+M yUVl2Mnu1+tzSeO4xzW4ar6J8FH5gN7aBk0ig1vRquzNIGAC+yP+oFi80C1hMJBSLyu2 db4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=zfNUWA2FT5JnALSz8JjIUuLr9sPx3kKVNCmRIeDr+04=; b=iH3ahOt1JhJ0FyuGu48dGSBt65eDwmWqOdqKrz9kyz3frPfCzCJQK7IS4skCdWuJrs fim9SLJjUho3NvZf5qgZeeIbHKG+VgkrkxC+3oBcs8ga7/YVFgmm096QQYeMWNi1DVv+ 3Cup9U/kRvfdNqQdL0LpsgK+OkC5cBSBe8yXPmmDDVgbgp2sBCSabA5a33NgKdX+81Vt JWnU1MtTdypYwkooCqxhFfqyiI1Nq/3EE9/KN9CVOuY+Fs2Arr3xodO6tAu/gB1EC8aQ IUlio9uVx1o99x7fnhFw0qtRTDTXHCp6YMaL/VyG+bvQKmgY/YO9JzHRO8Of/egqEFVx irfg== X-Gm-Message-State: AOUpUlHFEdVRrAnq44Pro2nffs4Mi7JD7Gjl8K55huyWuni28ijNBRnK kq37MsioNUmG7dhGM6aPcy92lC7BNr2ehg== X-Google-Smtp-Source: AAOMgpfFtrqHP8CcpV1Vr3MJUPr/VDHmKouQG1jpuFZytGfhr9U/vTsf2QngQKE7pHuiE8Ll1iAJfQ== X-Received: by 2002:aca:698c:: with SMTP id e134-v6mr332052oic.302.1532377249031; Mon, 23 Jul 2018 13:20:49 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id x5-v6sm7419935oix.3.2018.07.23.13.20.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:20:48 -0700 (PDT) From: Michael Roth <mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:17:12 -0500 Message-Id: <20180723201748.25573-64-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22b Subject: [Qemu-devel] [PATCH 63/99] nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Patch Round-up for stable 2.12.1, freeze on 2018-07-30
|
expand
|
diff --git a/block/nbd-client.c b/block/nbd-client.c index e7caf49fbb..8d69eaaa32 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -259,14 +259,18 @@ static int nbd_parse_blockstatus_payload(NBDClientSession *client, if (extent->length == 0 || (client->info.min_block && !QEMU_IS_ALIGNED(extent->length, - client->info.min_block)) || - extent->length > orig_length) - { + client->info.min_block))) { error_setg(errp, "Protocol error: server sent status chunk with " "invalid length"); return -EINVAL; } + /* The server is allowed to send us extra information on the final + * extent; just clamp it to the length we requested. */ + if (extent->length > orig_length) { + extent->length = orig_length; + } + return 0; }