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 934661EFFB0 for ; Thu, 1 May 2025 14:16:57 +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=1746109017; cv=none; b=AdfpZEHjFdwrWZvekH9gSNlj3keHZZJ33Ubi+7XykbFxhrO0IjBDbg5bnPWMazLBQ+uOwBgtmITi8SsK5gsXS4xxWfJjXrh7hNAfY9uLc094/W37GfV/HbyaoeOCTjW4O7+5lcNVCNbTcjlTxhWkK3PCJmt4lkcHb3RUVeSyp9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109017; c=relaxed/simple; bh=ImYNbhUgoKqyz/rhS/Gp/fuxIpKGFp4FU7tj5+UTRKs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cX/pJCweDJ3xClUzz6Q1wOoVdZd562s37o3dhzJc9YFn8ExNMG7tqwnIzNvYoUobPUILSnyoxMOXGictw1ILARLIZ/s4bB1Sh0Gw2DC5FrDSvjAW4tunZ4SaMzR4khN76hN4RCKTt5NtiGt/3NyYOOBzz3dc0mdtoHh14Zy/08k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=c98y3Q2j; 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="c98y3Q2j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C705C4CEE3; Thu, 1 May 2025 14:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109017; bh=ImYNbhUgoKqyz/rhS/Gp/fuxIpKGFp4FU7tj5+UTRKs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=c98y3Q2jeXL944tAPnvmjJ3quAaCrLvjSlTBcqoimQy9sZRHCIRqiBwzLaMyUHnQf Mx9gX6mCHfhQEoCkNixb4b+M8k2/kXMjlm/pAr7lkQFXFkclIPh+4dt12UtcMKqCrz yfaV5PUoKgZlaooWPf8cMM2+f8UXtSNRJV8zMAMM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49884: KVM: Initialize gfn_to_pfn_cache locks in dedicated helper Date: Thu, 1 May 2025 16:11:14 +0200 Message-ID: <2025050155-CVE-2022-49884-27c4@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=2852; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FzjUrfl+KouV3OZADaJrqefWk52WNfUQfaiVF/krVks=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDZuDn3wv1xcpMMkymrRuvcm7L1/a1bg57s1/YjDry fvX2jKvO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiJ6QYZjF9PKo588eThWpX rN+eVxH0Cv+yr5NhfsnKTbm3cyeu+TqpmXn76u4m1xOLBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: KVM: Initialize gfn_to_pfn_cache locks in dedicated helper Move the gfn_to_pfn_cache lock initialization to another helper and call the new helper during VM/vCPU creation. There are race conditions possible due to kvm_gfn_to_pfn_cache_init()'s ability to re-initialize the cache's locks. For example: a race between ioctl(KVM_XEN_HVM_EVTCHN_SEND) and kvm_gfn_to_pfn_cache_init() leads to a corrupted shinfo gpc lock. (thread 1) | (thread 2) | kvm_xen_set_evtchn_fast | read_lock_irqsave(&gpc->lock, ...) | | kvm_gfn_to_pfn_cache_init | rwlock_init(&gpc->lock) read_unlock_irqrestore(&gpc->lock, ...) | Rename "cache_init" and "cache_destroy" to activate+deactivate to avoid implying that the cache really is destroyed/freed. Note, there more races in the newly named kvm_gpc_activate() that will be addressed separately. [sean: call out that this is a bug fix] The Linux kernel CVE team has assigned CVE-2022-49884 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 982ed0de4753ed6e71dbd40f82a5a066baf133ed and fixed in 6.0.8 with commit 61242001d6c9c253df7645dab090842d8da08764 Issue introduced in 5.17 with commit 982ed0de4753ed6e71dbd40f82a5a066baf133ed and fixed in 6.1 with commit 52491a38b2c2411f3f0229dc6ad610349c704a41 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-49884 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: arch/x86/kvm/x86.c arch/x86/kvm/xen.c include/linux/kvm_host.h virt/kvm/pfncache.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/61242001d6c9c253df7645dab090842d8da08764 https://git.kernel.org/stable/c/52491a38b2c2411f3f0229dc6ad610349c704a41