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 6D265274B34 for ; Wed, 1 Oct 2025 07:47:50 +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=1759304870; cv=none; b=AtwijgzRAshzjq8XjehQem+7gAVAuDv7Lc7Svc10wE3Qa5DOWipNlHuDB6poxM6tGBIpmbqU27ZTWM4ypaT9XW5w8CMc0+j6nTnb+ZedLgS8jbxJCzZvdJxDaeQJn2e2/JXakkW75Qi9zYMp7uxw8fWdS1rcUx4tvbyc5DdqodE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759304870; c=relaxed/simple; bh=EfmAWUWyFT3cu92NeIjsrl76il6+/2zlwev7LPuPT90=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aBgRV9yMNcJby4EJ1qSEOavVKugQ7aYboQ7XuClqRHhKlljRCHLl3oyT4FVDrJvdpmE1AfUtRQYeHhx8Wf/wJLiPxxk68fLkV0JVunENTKBVfSS+AqYPDAlqjEnFpHQeDGj/vT+c6vqu6paPNGw2MANV6R7P2wykAwK3KrUfw9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B/nDXNFA; 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="B/nDXNFA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7E02C4CEF4; Wed, 1 Oct 2025 07:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759304870; bh=EfmAWUWyFT3cu92NeIjsrl76il6+/2zlwev7LPuPT90=; h=From:To:Cc:Subject:Date:Reply-to:From; b=B/nDXNFAB4j1I0D4VRvaoaj7eMRy1wRbaRP6nlHF4Mrq0vZEK5LPoGHuGl0kpiqLM 5l/J3rlFAz0dEX2ZTdxxfB0AS31zadHK25TGrixImFmr0HRpR0QPmT+ZgRgEA5LcFC 9W1E/6Vt0nRatWZTipSf3dH86mJns5HfW01X9tOA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39910: mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc() Date: Wed, 1 Oct 2025 09:47:15 +0200 Message-ID: <2025100110-CVE-2025-39910-568a@gregkh> X-Mailer: git-send-email 2.51.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=2791; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=D6YWXFfxenEW/5JRGOdg0ytMvHUrIdmxJi7LWk94CzA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl37tT5pK/df+Rd5EbFh46WZTE8Sxj15EWfKCz6+G6No q7AZlmbjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIojDDgknnWP4kq+xj5my9 rrM89/8ijWPsTxjmp+wPWeL5uJDx9u5NHY8U27t09bQzAQ== 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: mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc() kasan_populate_vmalloc() and its helpers ignore the caller's gfp_mask and always allocate memory using the hardcoded GFP_KERNEL flag. This makes them inconsistent with vmalloc(), which was recently extended to support GFP_NOFS and GFP_NOIO allocations. Page table allocations performed during shadow population also ignore the external gfp_mask. To preserve the intended semantics of GFP_NOFS and GFP_NOIO, wrap the apply_to_page_range() calls into the appropriate memalloc scope. xfs calls vmalloc with GFP_NOFS, so this bug could lead to deadlock. There was a report here https://lkml.kernel.org/r/686ea951.050a0220.385921.0016.GAE@google.com This patch: - Extends kasan_populate_vmalloc() and helpers to take gfp_mask; - Passes gfp_mask down to alloc_pages_bulk() and __get_free_page(); - Enforces GFP_NOFS/NOIO semantics with memalloc_*_save()/restore() around apply_to_page_range(); - Updates vmalloc.c and percpu allocator call sites accordingly. The Linux kernel CVE team has assigned CVE-2025-39910 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 451769ebb7e792c3404db53b3c2a422990de654e and fixed in 6.16.8 with commit 33b95d90427cb4babf32059e323a6d0c027610fe Issue introduced in 5.17 with commit 451769ebb7e792c3404db53b3c2a422990de654e and fixed in 6.17 with commit 79357cd06d41d0f5a11b17d7c86176e395d10ef2 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-39910 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: include/linux/kasan.h mm/kasan/shadow.c mm/vmalloc.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/33b95d90427cb4babf32059e323a6d0c027610fe https://git.kernel.org/stable/c/79357cd06d41d0f5a11b17d7c86176e395d10ef2