From nobody Wed Nov 19 21:03:06 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1618568973; cv=none; d=zohomail.com; s=zohoarc; b=MaW/7pFlu+HmgSR7UBg1G3j5Z365BT6DA8AMoud4IC/nImkdbgJ8Uv22KHR0wmyo+BHPTly0LewIuLXISH/Ez6pRs0RECKi/YbevmzsXPDOGoeuTD1LgiNjHOIM7GkOg5Uf2j/OuP/lfiy8zYMAXAHr5fULsIRIzPc+vgPbgsgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618568973; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=HZqwyA5p6jZZgRq5FFw+m15KsWBT5rJZQhgcr1tjSIc=; b=LrWLe/DCg0KUaEVP8m7V2IR0Ypv0T0Lh6O2R7spH8N8kgFYKHN36QrlfzubWwkwyNjjXAWsAGkWtzlghAfnanZ8ht2Rc69vbsIIZ62PjQjB7LMwGrZ/iuG99tsYOqVsYbMgx+AcoedBmz85yhUkTgUvEcRNyHhhl3v/Ov+Ca1Lk= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618568973215264.05824090334954; Fri, 16 Apr 2021 03:29:33 -0700 (PDT) Received: from localhost ([::1]:37616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXLj9-0000ZV-VY for importer@patchew.org; Fri, 16 Apr 2021 06:29:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXLcp-0006x0-3y; Fri, 16 Apr 2021 06:23:00 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:33255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXLcm-0002XP-Kv; Fri, 16 Apr 2021 06:22:58 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5F9134064D; Fri, 16 Apr 2021 13:22:44 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 4299E8C; Fri, 16 Apr 2021 13:22:44 +0300 (MSK) Received: (nullmailer pid 1293921 invoked by uid 1000); Fri, 16 Apr 2021 10:22:44 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Subject: [PATCH] mptsas: remove unused MPTSASState.pending (CVE-2021-3392) Date: Fri, 16 Apr 2021 13:22:43 +0300 Message-Id: <20210416102243.1293871-1-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.30.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: none client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , Prasad J Pandit , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" During previous attempt to fix CVE-2021-3392 it was discovered that MPTSASState.pending is actually not used. So instead of fixing the prob, just remove the offending code entirely Signed-off-by: Michael Tokarev Cc: Prasad J Pandit Cc: qemu-stable@nongnu.org Reported-by: Cheolwoo Myung Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/scsi/mptsas.c | 4 ---- hw/scsi/mptsas.h | 1 - 2 files changed, 5 deletions(-) diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 7416e78706..5abbc742aa 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -257,7 +257,6 @@ static void mptsas_free_request(MPTSASRequest *req) req->sreq->hba_private =3D NULL; scsi_req_unref(req->sreq); req->sreq =3D NULL; - QTAILQ_REMOVE(&s->pending, req, next); } qemu_sglist_destroy(&req->qsg); g_free(req); @@ -303,7 +302,6 @@ static int mptsas_process_scsi_io_request(MPTSASState *= s, } =20 req =3D g_new0(MPTSASRequest, 1); - QTAILQ_INSERT_TAIL(&s->pending, req, next); req->scsi_io =3D *scsi_io; req->dev =3D s; =20 @@ -1319,8 +1317,6 @@ static void mptsas_scsi_realize(PCIDevice *dev, Error= **errp) =20 s->request_bh =3D qemu_bh_new(mptsas_fetch_requests, s); =20 - QTAILQ_INIT(&s->pending); - scsi_bus_new(&s->bus, sizeof(s->bus), &dev->qdev, &mptsas_scsi_info, N= ULL); } =20 diff --git a/hw/scsi/mptsas.h b/hw/scsi/mptsas.h index b85ac1a5fc..c046497db7 100644 --- a/hw/scsi/mptsas.h +++ b/hw/scsi/mptsas.h @@ -79,7 +79,6 @@ struct MPTSASState { uint16_t reply_frame_size; =20 SCSIBus bus; - QTAILQ_HEAD(, MPTSASRequest) pending; }; =20 void mptsas_fix_scsi_io_endianness(MPIMsgSCSIIORequest *req); --=20 2.30.2