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 B331019A2A0 for ; Tue, 16 Jul 2024 12:28:43 +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=1721132923; cv=none; b=pW6ouZM9ZxF/0e4ZF6iahtr5QaYJEH4ayOzVEiZfUTAKwZjUaI2VwUqp8nyJPRLZTrYEdTvGs3FcVbEEVdOmknKg3t8TEyI+B7wrPMWWoDB9cHu1pAkTN40mDyj+7fLGOgSJ3CKhbh/Sp/SB5lfHohjQJ0cGXfIqyfa24oWmhTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721132923; c=relaxed/simple; bh=JJuUKUa2Gc4EtKwg9CCp7i3WsvZ2F3Ap2u5ORuiTXk4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gx9uugRFijhNxX+5J38kPNShyO80nJoPR8Mg71/XAKHkJ0gLZXQkMjlqns+/SXuMVlvsZykUln+OAxa0Ix5d60TmO34hnjzvbjuaZNzA5gDbQvd2htlpJaXlH5V7w6Z27SC9DtzICTari4vWLWmhQ0AGIN4eC+GIFtzECGXsefM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SuC/Jx+7; 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="SuC/Jx+7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F91AC116B1; Tue, 16 Jul 2024 12:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721132923; bh=JJuUKUa2Gc4EtKwg9CCp7i3WsvZ2F3Ap2u5ORuiTXk4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SuC/Jx+7qyPLC/zRTvRrbggrP63YuY2LtDidqdJr7Fg3D8sqwR1NSRiljEgwMnKLv GGFpSWP8XstDlgQWzlEtrXWfoBE17Oteu6XFvIRlhZ8VxRh32sY0Xhway2Ml83JTBr UQigH50ftZhcLX/bXuWY1++yZdSwZO4PEw7frx4g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48861: vdpa: fix use-after-free on vp_vdpa_remove Date: Tue, 16 Jul 2024 14:27:46 +0200 Message-ID: <2024071628-CVE-2022-48861-440e@gregkh> X-Mailer: git-send-email 2.45.2 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=2524; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JJuUKUa2Gc4EtKwg9CCp7i3WsvZ2F3Ap2u5ORuiTXk4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnT0g0uqB/64Lx5R8LBS6HN19ycL/06fSrnpc6/+zOu3 u/M2tEa2xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATeXyDYQ5HwIG4+pz0h7HF YQ01u7fkzMkJecEwP00jW0JZ+gRbf+uqp7lrDbe2T+DxAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: vdpa: fix use-after-free on vp_vdpa_remove When vp_vdpa driver is unbind, vp_vdpa is freed in vdpa_unregister_device and then vp_vdpa->mdev.pci_dev is dereferenced in vp_modern_remove, triggering use-after-free. Call Trace of unbinding driver free vp_vdpa : do_syscall_64 vfs_write kernfs_fop_write_iter device_release_driver_internal pci_device_remove vp_vdpa_remove vdpa_unregister_device kobject_release device_release kfree Call Trace of dereference vp_vdpa->mdev.pci_dev: vp_modern_remove pci_release_selected_regions pci_release_region pci_resource_len pci_resource_end (dev)->resource[(bar)].end The Linux kernel CVE team has assigned CVE-2022-48861 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 64b9f64f80a6 and fixed in 5.15.29 with commit 4b1743bc715a Issue introduced in 5.13 with commit 64b9f64f80a6 and fixed in 5.16.15 with commit dc54ba9932ae Issue introduced in 5.13 with commit 64b9f64f80a6 and fixed in 5.17 with commit eb057b44dbe3 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-48861 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/virtio_pci/vp_vdpa.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/4b1743bc715a3691a63ac21b349079b07bf1b19e https://git.kernel.org/stable/c/dc54ba9932aeaaa1a21fe214af1f446593a78274 https://git.kernel.org/stable/c/eb057b44dbe35ae14527830236a92f51de8f9184