Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2DC2F3C584F for ; Sun, 18 Oct 2026 15:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792338848; cv=none; b=HUZWoDvbAjl15hkNHPrmNRR6xyULMVs+mEQVX+dR66XyOpfxrUgCbjrvB0jrCbkMbcOb6p7GD5iNtnGDYHMHymTUQI7w91iAEPFDicBjvVVWcz2bkDpkJN3QQ/nHhNbxDeX4uQJDA6OWHi1hjhy+8lxhfYfK2A4/KswBvjcwoPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792338848; c=relaxed/simple; bh=V0yLL3g2KMbh/3RvDnITOURKofIXdxQcZRuZd1BG3hk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ruz9rCYJtmNCOXZJ/0iAoXFR+b/c+7EWUyK9eYXznOAQunSgcN5KP5IqejMJq6KydeOv8T+zsSGKWcTPv+yGtwEuQUUY94OmfT1Ww9FOcvMbUJh2KcGuGyNefMru457WFK7h+xJDB6a2ISrmAiUSBR3woL8++/OYA5YKzwnkOmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WtnS6lgn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WtnS6lgn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01EE31F000C4; Sun, 18 Oct 2026 15:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792338845; bh=xUj8DvVvvr0+PvY34PtGkW0ce8619j4l52K7zOo9588=; h=From:To:Cc:Subject:Date:Reply-To; b=WtnS6lgnD0UI3ywC6UWQCJndFX1gscjgA3vhI29oI4C/nOYkASFej9W3kKSb65uGS 7aCjfx6W9OJWGibhL5Ro8aeR9OzH96RsVHLcxo/kYwVujGSbU7IABF06RwMdmRVelJ WsnwHbIASvPHOLmqoJ8VGJvqhjktKTmcGvuw5Jp8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98719: KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it Date: Sun, 18 Oct 2026 17:44:54 +0200 Message-ID: <2026101808-CVE-2026-98719-d823@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3039; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=f4hJ2/rIOmWdKWsWfzhqafzetvGwPtjE7LPYmeMeukk=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlXXnpwVj8P2+9X/i1uwcncfYIGbG9/xj3ffs6kNbmu1 mdzmvb2jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIvCUMC+Y/cM92at/P0pKw l3On9fe/p+tCVRnm565J+PP+deUvhtTr0/4/k1vTPafjIQA= 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: SEV: Nullify "have run CPUs" mask pointer when freeing it Nullify have_run_cpus when freeing the mask, particularly in the error path of __sev_guest_init(), so that KVM doesn't have to subtly use sev->active to track whether or not the mask has been freed. As pointed out by Sashiko, blindly freeing the mask in sev_vm_destroy() results in a double-free if the mask is freed if __sev_guest_init() fails. Throw the logic in a helper as nullifying the pointer is frustratingly difficult and weird due to have_run_cpus being a single-entry array when CPUMASK_OFFSTACK=n. Deliberately don't use CPUMASK_VAR_NULL, as it's not directly assignable when the cpumask is on-stack, e.g. requires using a local variable and a memcpy(), which is beyond ridiculous. Furthermore, while clearing the on-stack bitmask is an unnecessary and arguably unwanted side effect, KVM absolutely relies on '0' being the "null" value given that the struct is zero-allocated. Opportunistically add an alloc() helper to pair with free(); there are just enough call sites to make doing so worthwhile. The Linux kernel CVE team has assigned CVE-2026-98719 to this issue. Affected and fixed versions =========================== Issue introduced in 6.18.55 with commit 6aef7cf800098749ff5d660222efaf6e01e98c09 and fixed in 6.18.56 with commit b1de3ebf59507e0edacaa5cfa2225bc1869e1b63 Issue introduced in 7.2.9 with commit 9784e5ca91b37b387f3f414af4340c54f7a63566 and fixed in 7.2.10 with commit 0fbc7fec2242de6c3dcea6de55573c428e820173 Issue introduced in 7.3-rc5 with commit 12c1f6e03f944e399bd2c88441dca5dc702b95a5 and fixed in 7.3-rc6 with commit 8abbc76120a74bfba1851bd97528099d715e45c6 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-2026-98719 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/svm/sev.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/b1de3ebf59507e0edacaa5cfa2225bc1869e1b63 https://git.kernel.org/stable/c/0fbc7fec2242de6c3dcea6de55573c428e820173 https://git.kernel.org/stable/c/8abbc76120a74bfba1851bd97528099d715e45c6