From nobody Sat Sep 26 21:37:18 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=swemel.ru ARC-Seal: i=1; a=rsa-sha256; t=1789481173; cv=none; d=zohomail.com; s=zohoarc; b=KXXVMPHYeINSgkl4TzGqqj8oX1TnP4xKYdwKbHyCVbqNw+BPxNyihwurqcCsWtsk1Xz7uU35XdX3K8ZbLOPuYCzXfznyhbOOeMuLNJ5WbHitYNyRtBcIZRIfcGAUGt8/PNTdPXuCq4yRV0CszHlzDlLOGtSAqgXDKB60FE11te8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789481173; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sC5Vxlg6n+Lp8ZrqtKzTe6WEDKCQ3vM7wXZvTLaGDV0=; b=nQ5w2oOw9krHebCMp6cE5AFPx8c9Q3GZg7DakyZFPMob2LkYb+g0nEGvq0/V3TBRawcqjN2YFvXXhISDXFBYKmxSxYPQpBrGUH5uRCe8lsRjiNSujka2XFyyfL8PP65jpEpcxNXoHqKueFkuqtgwFQ+Etg2qha3w3NgZXKmdVsI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789481173024360.27047063593216; Tue, 15 Sep 2026 07:06:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6Tmt-0001KD-OI; Tue, 15 Sep 2026 10:05:31 -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 1x6So7-0000Aw-7k for qemu-devel@nongnu.org; Tue, 15 Sep 2026 09:02:46 -0400 Received: from mx.swemel.ru ([95.143.211.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6So2-00048R-Tj for qemu-devel@nongnu.org; Tue, 15 Sep 2026 09:02:42 -0400 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1789477351; h=from:from: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; bh=sC5Vxlg6n+Lp8ZrqtKzTe6WEDKCQ3vM7wXZvTLaGDV0=; b=UmwLqBkI1ODD+yJz6qqx6t4oDKJR6xv/DXu29jfRvez2pye/PDKi86HzHlk6z45YaUt5xM 666rKBfsGZ18rhvlCBFrO+kAr198JHzIArysrMb6LYK7G4FQ4IcmJGO/XMBBvBi9NY4bzL WcDACuy4brvWkNX6+Y2togtZquh+FLU= Date: Tue, 15 Sep 2026 16:02:31 +0300 MIME-Version: 1.0 Content-Language: en-US, ru-RU To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, mst@redhat.com From: =?UTF-8?B?0J3QuNC60L7Qu9Cw0Lkg0JfQvtGA0LjQvQ==?= Subject: [PATCH] util/vhost-user-server: fix potential NULL dereference in vu_message_read Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=95.143.211.150; envelope-from=zorin@swemel.ru; helo=mx.swemel.ru 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 15 Sep 2026 10:05:29 -0400 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @swemel.ru) X-ZM-MESSAGEID: 1789481180305158500 The `vu_message_read()` function initializes `local_err` to `NULL`. If `server->ioc` is `NULL`, the execution jumps to the `if (!ioc)` branch and invokes `error_report_err(local_err)`. Passing a guaranteed `NULL` pointer to `error_report_err()` leads to a crash because `error_get_pretty(err)` will attempt to dereference `err->msg`, triggering a Segmentation Fault (`SIGSEGV`). Since `server->ioc` shouldn't be `NULL` during an active coroutine execution, this error block is effectively dead code, but it represents a dangerous pattern left over from copy-pasting or incomplete refactoring. Fix this by removing the incorrect `error_report_err(local_err)` call inside the `if (!ioc)` block. The `local_err` variable itself is preserved as it is used later in the function for actual I/O error handling. Signed-off-by: Nikolay N Zorin --- =C2=A0util/vhost-user-server.c | 1 - =C2=A01 file changed, 1 deletion(-) diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index f30f6b3e..a4b2c1d0 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -15,7 +15,6 @@ static bool coroutine_fn vu_message_read(VuDev=20 *vu_dev, int conn_fd, VhostUserMs =C2=A0 =C2=A0 =C2=A0vmsg->fd_num =3D 0; =C2=A0 =C2=A0 =C2=A0if (!ioc) { -=C2=A0 =C2=A0 =C2=A0 =C2=A0 error_report_err(local_err); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail; =C2=A0 =C2=A0 =C2=A0} --=20 2.43.0