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 A9F092D374B for ; Thu, 3 Jul 2025 08:36:26 +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=1751531786; cv=none; b=RLT/A2pBzEGGZXYUJwzJV8WOupzT2URL41u5FK5sO40lhIKZwgU7ZJuTI+ct9OmZk8iTyaMeEpaBB8DQmGDNEotiF0hGg/gZuqpwl5agFY+i+nv5s5mLa6RyZXzaoI1rZ8oEbUdoM3XizUJJigulEyhZmcx3qge0gqh0hTk/nRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751531786; c=relaxed/simple; bh=0rul+Z8wvtnWVwA/JT3aeHDcebVVma6XJP2RchYcw/U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Z9slasPnt4g56bZlKi1tdPUp14vOTWAx6vSjKbsy0DkkbTmMzW/nb8MClR46ltqDdE7Q9e9pkrzOh5/FcFR8+8BE5m0429oBhtEn5vSH4LKTA9pPa4t8WKhgTfM6TE6N99FaVEBdqTsZjGbsBP+WPu1o3ex0RrrM8tHmRkde5ng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q9C7iZTL; 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="q9C7iZTL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17067C4CEF3; Thu, 3 Jul 2025 08:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751531786; bh=0rul+Z8wvtnWVwA/JT3aeHDcebVVma6XJP2RchYcw/U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=q9C7iZTLG4f3nC/pBZg9GG1HcKA022xR8WZm/KL860NawJF+/rAh4emnfRXCNxpas q8UUaBEVc78Oyrqj/X+kDNPW/I2/yJPYDTyNacKGgQ56vn9lO0H12afAHz7Cwqp+IE vFnrCuLUvdYutEdQn0hDmHT8DZ7Qmxhkd7lWr8TM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38102: VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify Date: Thu, 3 Jul 2025 10:35:20 +0200 Message-ID: <2025070321-CVE-2025-38102-d592@gregkh> X-Mailer: git-send-email 2.50.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=4377; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=NvY9hgXGMtSVn6OyuqomUs+MwvEaaNVzQ9Ddsxos/vg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlpDifbt6zWvFeU39lxccZF1iZbWxaDHJ8NdWnHtwT3m ncpbdPqiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgInceM+w4ETq4+PLzp7mffPq qHXtxkn1O7O2yjHM01kbZSGdeipYqbJcTNVuh5tD0OvNAA== 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: VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify During our test, it is found that a warning can be trigger in try_grab_folio as follow: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1678 at mm/gup.c:147 try_grab_folio+0x106/0x130 Modules linked in: CPU: 0 UID: 0 PID: 1678 Comm: syz.3.31 Not tainted 6.15.0-rc5 #163 PREEMPT(undef) RIP: 0010:try_grab_folio+0x106/0x130 Call Trace: follow_huge_pmd+0x240/0x8e0 follow_pmd_mask.constprop.0.isra.0+0x40b/0x5c0 follow_pud_mask.constprop.0.isra.0+0x14a/0x170 follow_page_mask+0x1c2/0x1f0 __get_user_pages+0x176/0x950 __gup_longterm_locked+0x15b/0x1060 ? gup_fast+0x120/0x1f0 gup_fast_fallback+0x17e/0x230 get_user_pages_fast+0x5f/0x80 vmci_host_unlocked_ioctl+0x21c/0xf80 RIP: 0033:0x54d2cd ---[ end trace 0000000000000000 ]--- Digging into the source, context->notify_page may init by get_user_pages_fast and can be seen in vmci_ctx_unset_notify which will try to put_page. However get_user_pages_fast is not finished here and lead to following try_grab_folio warning. The race condition is shown as follow: cpu0 cpu1 vmci_host_do_set_notify vmci_host_setup_notify get_user_pages_fast(uva, 1, FOLL_WRITE, &context->notify_page); lockless_pages_from_mm gup_pgd_range gup_huge_pmd // update &context->notify_page vmci_host_do_set_notify vmci_ctx_unset_notify notify_page = context->notify_page; if (notify_page) put_page(notify_page); // page is freed __gup_longterm_locked __get_user_pages follow_trans_huge_pmd try_grab_folio // warn here To slove this, use local variable page to make notify_page can be seen after finish get_user_pages_fast. The Linux kernel CVE team has assigned CVE-2025-38102 to this issue. Affected and fixed versions =========================== Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 5.15.186 with commit b4209e4b778e4e57d0636e1c9fc07a924dbc6043 Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 6.1.142 with commit 58a90db70aa6616411e5f69d1982d9b1dd97d774 Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 6.6.94 with commit 6e3af836805ed1d7a699f76ec798626198917aa4 Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 6.12.34 with commit 00ddc7dad55b7bbb78df80d6e174d0c4764dea0c Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 6.15.3 with commit 75b5313c80c39a26d27cbb602f968a05576c36f9 Issue introduced in 4.0 with commit a1d88436d53a75e950db15834b3d2f8c0c358fdc and fixed in 6.16-rc1 with commit 1bd6406fb5f36c2bb1e96e27d4c3e9f4d09edde4 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-2025-38102 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/misc/vmw_vmci/vmci_host.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/b4209e4b778e4e57d0636e1c9fc07a924dbc6043 https://git.kernel.org/stable/c/58a90db70aa6616411e5f69d1982d9b1dd97d774 https://git.kernel.org/stable/c/6e3af836805ed1d7a699f76ec798626198917aa4 https://git.kernel.org/stable/c/00ddc7dad55b7bbb78df80d6e174d0c4764dea0c https://git.kernel.org/stable/c/75b5313c80c39a26d27cbb602f968a05576c36f9 https://git.kernel.org/stable/c/1bd6406fb5f36c2bb1e96e27d4c3e9f4d09edde4