Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23174289E14 for ; Wed, 18 Jun 2025 11:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244859; cv=none; b=tB5fZ3odzA/9PY9OpUkFyte0V7l1/2yA2FWPPeXzw9tiWfvh6ED3hGQ+DE+KXTY75stD28/9ESxs/jlz4pfXyps+j//t/ydU1+yKdKwmmyS4Wk3qB0YmLSPW/feHVwxn35VAQiHsBLy7e/y9LcQleY3aXzvYrgtJFTdm0Rn/6Ic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244859; c=relaxed/simple; bh=jWjbML4XJyLHwMhxgeTkBEZW9vgegg2MwZ5HrP7ExwM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kfNXS2zx9wua9FTnx2kTRj5t4S7oH5qpt8nz+Glfqa6xpE/A9UVdbYt1S/XUwdz1Lv+IczyveCIZ6DbmRHTrxd0syrHg/Dm9gRnofkKi5we2I4KMD+I5K+Y/xkyvBmbfIKGjUPnftJWkzq4xrbTOgDrPMNAcMRL34Mf36VlYaK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HfiS2Ysj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HfiS2Ysj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A81CCC4CEE7; Wed, 18 Jun 2025 11:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244859; bh=jWjbML4XJyLHwMhxgeTkBEZW9vgegg2MwZ5HrP7ExwM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HfiS2YsjIpyWjB2iShPPgkil8Lidj2PYzWBlq/adusboFzd7q1fGmBVxow/EBz+nZ IKQAIIi4p2o3XhI0JvYUDNzmRfEpGPhwICycmRMcpIrmJ36BuSIPK0rclJPsH8cK+g blrd7nOxA86AzVyDoaJSuNjiJATW6Q4qHXMZEYco= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50058: vdpa_sim_blk: set number of address spaces and virtqueue groups Date: Wed, 18 Jun 2025 13:02:03 +0200 Message-ID: <2025061848-CVE-2022-50058-212f@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2622; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=fPkr2J8CosH+Jr42ctoDhF1dt/5v0HAIFiLa8W9BUd8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBcxIulydG7UqULSxMeNAWoG98wOCYcsKlnJoli22rf 959b1fQEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOZX8Ewz/DOX8Pfc9yMeh3U d0nqrVIxq3paxjA/+7ZnoHm+48nUb0aW7/Ypf9if4XcIAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: vdpa_sim_blk: set number of address spaces and virtqueue groups Commit bda324fd037a ("vdpasim: control virtqueue support") added two new fields (nas, ngroups) to vdpasim_dev_attr, but we forgot to initialize them for vdpa_sim_blk. When creating a new vdpa_sim_blk device this causes the kernel to panic in this way:    $ vdpa dev add mgmtdev vdpasim_blk name blk0    BUG: kernel NULL pointer dereference, address: 0000000000000030    ...    RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]    ...    Call Trace:         vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]     vdpasim_map_range+0x91/0xd0 [vdpa_sim]     vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]     ... This happens because vdpasim->iommu[0] is not initialized when dev_attr.nas is 0. Let's fix this issue by initializing both (nas, ngroups) to 1 for vdpa_sim_blk. The Linux kernel CVE team has assigned CVE-2022-50058 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit bda324fd037a6b0d44da5699574ce741ca161bc4 and fixed in 5.19.4 with commit a291c7d289fac2cb13fb2614a9a251afbbd86ce9 Issue introduced in 5.19 with commit bda324fd037a6b0d44da5699574ce741ca161bc4 and fixed in 6.0 with commit 19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50058 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/vdpa/vdpa_sim/vdpa_sim_blk.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9 https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809