From nobody Tue Nov 26 22:21:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1703418256; cv=none; d=zohomail.com; s=zohoarc; b=l70oJxXg/2VZXr0bqOOdK+sQp7dTzNfiz8GBgI6GvyZlWP0715kG2VBMFefNPq4ZmMaw68kvExU33NsfCl2xIy9dEznCbSCWFiWVZtHPbYft3+gjujm0HFrP/wZiXEaakWFoQk/Fq/bGg/EzRvBBlYUSShRZtWiXOGV8J85f2x4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703418256; h=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:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=3yGV4mOi0KQ6t7hVWpcEKqxjYVWJQvvSim37sTrI/1Y=; b=gsfTcCwrxQ17uyr+6YwGT0osveuxcTn+9bkh1dylSEAFr9CZ8xWz9srzgsLZ/rrA0Q8D+cImp7j08BkcD/NPbSlKzxlCSu1/uwBBnAo3iTkfSQ4/wN0mfjmsHEA0UxX6XFy5ADBmkDkEyV1Th2rdRcxa8CRC2oIuPwarXiaEHag= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1703418256448131.29939743820057; Sun, 24 Dec 2023 03:44:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHMtC-00020n-Bd; Sun, 24 Dec 2023 06:43:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rHMtA-0001zt-9b; Sun, 24 Dec 2023 06:43:24 -0500 Received: from mail.weilnetz.de ([37.120.169.71] helo=mail.v2201612906741603.powersrv.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rHMt8-0006WU-DL; Sun, 24 Dec 2023 06:43:24 -0500 Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by mail.v2201612906741603.powersrv.de (Postfix) with ESMTP id 05CAEDA0553; Sun, 24 Dec 2023 12:43:17 +0100 (CET) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 7D27646001A; Sun, 24 Dec 2023 12:43:17 +0100 (CET) To: Stefan Hajnoczi , Kevin Wolf Cc: Hanna Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Stefan Weil Subject: [PATCH] virtio-blk: Fix potential nullpointer read access in virtio_blk_data_plane_destroy Date: Sun, 24 Dec 2023 12:43:14 +0100 Message-Id: <20231224114314.420360-1-sw@weilnetz.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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=lists.gnu.org; Received-SPF: pass client-ip=37.120.169.71; envelope-from=stefan@weilnetz.de; helo=mail.v2201612906741603.powersrv.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Stefan Weil From: Stefan Weil via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1703418258440100001 Content-Type: text/plain; charset="utf-8" Fixes: CID 1532828 Fixes: b6948ab01d ("virtio-blk: add iothread-vq-mapping parameter") Signed-off-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/block/dataplane/virtio-blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-bl= k.c index 6debd4401e..97a302cf49 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -152,7 +152,7 @@ bool virtio_blk_data_plane_create(VirtIODevice *vdev, V= irtIOBlkConf *conf, void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s) { VirtIOBlock *vblk; - VirtIOBlkConf *conf =3D s->conf; + VirtIOBlkConf *conf; =20 if (!s) { return; @@ -160,6 +160,7 @@ void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane= *s) =20 vblk =3D VIRTIO_BLK(s->vdev); assert(!vblk->dataplane_started); + conf =3D s->conf; =20 if (conf->iothread_vq_mapping_list) { IOThreadVirtQueueMappingList *node; --=20 2.39.2