From nobody Sun Nov 24 09:53:48 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1724129196; cv=none; d=zohomail.com; s=zohoarc; b=T7aAVCrFo3DHaJ5js+IXtnMAMpvApyNSRpcjFCVQ3e8mkRSfLpWcY0ne4M4g6Kt4Smukn6+voIwEwHjtpKXh7NTLJOBt09ZjUD2lOJ3WXGo2px0SPEATIH7aRXQp1ddvKxkJ3kJZRloMua9aiDAkibWAvYMVqV1+H8Ps80r2PGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724129196; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HVAtgXy50HM9RFO1/6tZGIwc/XjCv1WORDOYVlqO4CY=; b=kRerGxqiWxdTBjgTvWHXWKBq3CGoKuNCigMbrheYw1rULsPkKRjpPdhSf6+puhuvg0LQpQ/L/z2OlOIOhTLhrw5iLSJO3r4qkjY2TYx9eOYz7QV6xnT3wRjs9dUZrIVwGxnAD7KxRhMkBSLi7zrP85rn8vA1CmEfp44W6d8VMSo= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724129196303773.0496379644344; Mon, 19 Aug 2024 21:46:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgGkU-0007rC-3x; Tue, 20 Aug 2024 00:45:38 -0400 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 1sgGkB-0007gT-A9; Tue, 20 Aug 2024 00:45:31 -0400 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgGk6-0004Rz-IO; Tue, 20 Aug 2024 00:45:17 -0400 Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id B62BE1151BB3; Tue, 20 Aug 2024 00:45:12 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 20 Aug 2024 00:45:12 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Aug 2024 00:45:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1724129112; x= 1724215512; bh=HVAtgXy50HM9RFO1/6tZGIwc/XjCv1WORDOYVlqO4CY=; b=D lNC7UqXytsm9orx4QBKx5EBuKSlkF5KnqWPIH3FyGeKumC1xBCkT+c3kJ6JUVya9 z6oSj4lsHMsWFba0G7r1tFeKveOQhUyBrLDHFdhyh9jYkAJOnT0eaoBJeZ6k011t qF66PkAwX4jnYO0Wca7IZ9q16g10Zbuf3U2EDanUEwmb4KPOpzZG3kE61RvCI+Io UQVxWRjZxdMiQhpr3WDWO6NcSDTBxOyCU2JoY36Rdd8Letshkc5mwmW3aMzc9xP+ x0mkqwYrVRoBdTYO4BLZjXEnibRlJ68U11V1pWK0KAazR0+cY5qgL8GYNKpPjhHQ QOuFkcsBIvq1GryKa9ePg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724129112; x= 1724215512; bh=HVAtgXy50HM9RFO1/6tZGIwc/XjCv1WORDOYVlqO4CY=; b=K 3/mk2VDoX1/771DtnRlw6An6tnd5+SONOM4cI+vkan5dfrS0ukj+T7zQoz49y8md +/qDHfYrRTJUO2CZhbYtzstyqzTxKoIEZwEi9kVKbqgs1a1sfAIb0jvtC0nN09cQ 1mpjpHdMrRltv9sSj3LuifMvwiFEtvoiMWeeot9NF8oJeU0/OP5MfffBgkP7KoJD D580wSoUk7C3Ooy391MoganVuRflGzfp82fugSA/AO6aION6quf1qdwaIuZv4ljE EBcHMVMdusLpL6WdsyVF5WU8EHuCGLWyUhKjsi9CdjHz80VJvsOKFJQxPxHdyzgm XggxyprPryOqnJRyeBfBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudduhedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomhepmfhlrghushculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrd gukheqnecuggftrfgrthhtvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfeh fefgjeejhefffeegudejudegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukhdpnhgspghrtghpthht ohepuddtpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpvghtvghrrdhmrgihug gvlhhlsehlihhnrghrohdrohhrghdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhho nhhgnhhurdhorhhgpdhrtghpthhtohepkhgsuhhstghhsehkvghrnhgvlhdrohhrghdprh gtphhtthhopehqvghmuhdqshgvtghurhhithihsehnohhnghhnuhdrohhrghdprhgtphht thhopehqvghmuhdqsghlohgtkhesnhhonhhgnhhurdhorhhgpdhrtghpthhtohepfhhosh hsseguvghfmhgrtghrohdrihhtpdhrtghpthhtohepihhtshesihhrrhgvlhgvvhgrnhht rdgukhdprhgtphhtthhopehkrdhjvghnshgvnhesshgrmhhsuhhnghdrtghomhdprhgtph htthhopehqvghmuhdqshhtrggslhgvsehnohhnghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: Peter Maydell , qemu-devel@nongnu.org Cc: Keith Busch , qemu-security@nongnu.org, qemu-block@nongnu.org, Jesper Devantier , Klaus Jensen , Klaus Jensen , qemu-stable@nongnu.org, Yutaro Shimizu Subject: [PULL for-9.1 1/1] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv Date: Tue, 20 Aug 2024 06:45:07 +0200 Message-ID: <20240820044505.84005-4-its@irrelevant.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240820044505.84005-3-its@irrelevant.dk> References: <20240820044505.84005-3-its@irrelevant.dk> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=880; i=k.jensen@samsung.com; h=from:subject; bh=dmvovNmsI1IDFQuXVJiFls1WySo1nP5aa4y1cnkMalw=; b=owJ4nAFtAZL+kA0DAAoBTeGvMW1PDekByyZiAGbEH1HhSw7IDeD0skseRiuzJqX3JkHJ0ioN0 +KN5hl5WzPNbYkBMwQAAQoAHRYhBFIoM6p14tzmokdmwE3hrzFtTw3pBQJmxB9RAAoJEE3hrzFt Tw3pUHAIAK6JNXpTdFrxcQanezOo13p6TjFMmPDHa6AMbXoRuszBX1PBYxYkIq1EqjdriGXntoo lWvmwzPhtDkOwavocTsY6PL+yaeqdcicVskNnql43Gzo8utpTzGWrByqc5Bf+iLrp+Et+plQ8g0 dSBKWfs9CaelvBLztqUtcBe41RCIj27JofvsTD40c5o9x1pf6K2UNRmC5tHNd+KkBhZ7yIbG0ML aEYkECz4VQX85T8yQYDvEKO+YKO2pnsTV1rvgyrF7YNgp1Ie75sng8j/FZehl7lM/XwEs7b9QFf NoRgax9b8d2/6iQToFHm6D0fKTuGUwAJAaH+SmdUyM5wpSgzfEAC9KQ+ X-Developer-Key: i=k.jensen@samsung.com; a=openpgp; fpr=DDCA4D9C9EF931CC3468427263D56FC5E55DA838 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=103.168.172.153; envelope-from=its@irrelevant.dk; helo=fhigh2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @irrelevant.dk) X-ZM-MESSAGEID: 1724129197812116600 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Yutaro Shimizu from the Cyber Defense Institute discovered a bug in the NVMe emulation that leaks contents of an uninitialized heap buffer if subsystem and FDP emulation are enabled. Cc: qemu-stable@nongnu.org Reported-by: Yutaro Shimizu Signed-off-by: Klaus Jensen Reviewed-by: Jesper Devantier --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index c6d4f61a47f9..9f277b81d83c 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -4474,7 +4474,7 @@ static uint16_t nvme_io_mgmt_recv_ruhs(NvmeCtrl *n, N= vmeRequest *req, =20 nruhsd =3D ns->fdp.nphs * endgrp->fdp.nrg; trans_len =3D sizeof(NvmeRuhStatus) + nruhsd * sizeof(NvmeRuhStatusDes= cr); - buf =3D g_malloc(trans_len); + buf =3D g_malloc0(trans_len); =20 trans_len =3D MIN(trans_len, len); =20 --=20 2.45.2