Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C898C624D3 for ; Tue, 1 Sep 2026 17:55:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x1Sh0-000889-4T; Tue, 01 Sep 2026 13:54:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x1Sgz-00087y-8m for qemu-devel@nongnu.org; Tue, 01 Sep 2026 13:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x1Sgw-0003vs-Pm for qemu-devel@nongnu.org; Tue, 01 Sep 2026 13:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788285277; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HNtp0MogpxedTDzsD6+eDFMpCoqhgzd0SDwdJ6FAx/Y=; b=crbzkcVeaHBy7sYcTiyPhU2IMwjEDZlzuFWoQ27T5p3LKHSLLFcI90Xcrny9rl4OpRmasH qKss3LJ9Lh2BJ6/hc086aWigHESKYbc4KnCkSWj0RZpfkqe7z0IrQ3x8z+H3KDDL2Ywo78 o8KF9YQLGGZl5YYZ9NRFhdweynHdGFY= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-WGzw848iODiDIjWe275gVg-1; Tue, 01 Sept 2026 13:54:36 -0400 X-MC-Unique: WGzw848iODiDIjWe275gVg-1 X-Mimecast-MFC-AGG-ID: WGzw848iODiDIjWe275gVg_1788285275 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BBCC3182A108; Tue, 1 Sep 2026 17:54:34 +0000 (UTC) Received: from redhat.com (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 21BB0279; Tue, 1 Sep 2026 17:54:32 +0000 (UTC) Date: Tue, 1 Sep 2026 18:54:30 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: "Denis V. Lunev" , Mauro Matteo Cascella Cc: marcandre.lureau@redhat.com, "Denis V. Lunev" , qemu-devel@nongnu.org Subject: Re: [PATCH 0/6] io/channel-websock: fix an unauthenticated crash in the handshake Message-ID: References: <20260831100151.914178-1-den@openvz.org> <178817576852.2700790.2039576285438786814.b4-review@b4> <41cebb76-bc3c-4f69-82b3-7517122ab2e5@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41cebb76-bc3c-4f69-82b3-7517122ab2e5@virtuozzo.com> User-Agent: Mutt/2.4.0 (2026-06-19) X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Mon, Aug 31, 2026 at 01:33:14PM +0200, Denis V. Lunev wrote: > On 8/31/26 13:29, marcandre.lureau@redhat.com wrote: > >> A client which can reach a VNC websocket port crashes QEMU before it has > >> authenticated, by sending an HTTP greeting whose request line holds no > >> space: > >> > >> printf 'stats\r\nx\r\n\r\n' | nc $host $port > >> > >> Three defects line up to produce it. The greeting is rejected without > >> queueing a response, so the handshake goes on to flush an empty buffer. > >> A zero length sendmsg() succeeds and returns 0, which > >> qio_channel_socket_writev() mistakes for failure and reports as > >> QIO_CHANNEL_ERR_BLOCK with errp left unset. The handshake treats every > >> negative return as fatal and hands that NULL Error to > >> error_get_pretty(). Patches 1 to 3 close the three links. > >> > >> Patch 5 is the same NULL Error on the read side of the handshake, where > >> ERR_BLOCK is folded into -1. It is reachable for a wss:// client, whose > >> master channel is then a TLS channel: a wakeup carrying only part of a > >> record makes gnutls report EAGAIN. > >> > >> The tests drive the handshake through a channel which reports ERR_BLOCK > >> on demand, covering both directions. No test reproduces the original > >> crash itself, which turns on a stale errno and is not reliably > >> reproducible in a unit test. What they pin is that a 400 is emitted and > >> that ERR_BLOCK no longer reaches error_get_pretty(). > >> > >> Signed-off-by: Denis V. Lunev > >> CC: Daniel P. Berrangé > >> CC: Marc-André Lureau > >> > >> Denis V. Lunev (6): > >> io/channel-socket: do not treat a zero length write as an error > >> io/channel-websock: send an HTTP 400 when the greeting has no space > >> io/channel-websock: handle a blocked write during the handshake > >> tests/unit: add websock handshake test > >> io/channel-websock: do not lose QIO_CHANNEL_ERR_BLOCK while reading > >> tests/unit: cover blocked IO during the websock handshake > >> > >> io/channel-socket.c | 2 +- > >> io/channel-websock.c | 10 +- > >> tests/unit/meson.build | 1 + > >> tests/unit/test-io-channel-websock.c | 249 +++++++++++++++++++++++++++ > >> 4 files changed, 260 insertions(+), 2 deletions(-) > >> create mode 100644 tests/unit/test-io-channel-websock.c > >> > > Patch series lgtm. You cc stable, why didn't you file a CVE? > > > > Reviewed-by: Marc-André Lureau > > > I have calculated the scope and get around 6.2 which is > not looking too impressive to spend a time. In the context of a VNC server enabling websocket. If we assume the VNC server has authentication enabled, including the TLS extension VeNCrypt, then the deployment can be said to be protecting against a malicious client. The flaws mean the malicious client can inflict a denial of service attack on the VM before getting to the VNC authentication step. IMHO that is enough to justify a CVE assignment. CC'ing Mauro to double check my view & assign a CVE if appropriate With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|