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 4D01C3DE44B for ; Fri, 24 Apr 2026 14:43:53 +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=1777041833; cv=none; b=u3wgBqVU3uBcttzd0LDbgrGDKAe7V74PF6NyVVNGc5EMourwaChCvMRuzT9G2k/PbHFyQ321uS6CCpUnWsRCm2+L+AoF9OJYM8bvv/plkCXAk4ClMh4YrjGum5kcGKwOPBimu2UH5iEXKFY7Q86zQOcbRVeTEfNnxqZ+Ei1yy6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041833; c=relaxed/simple; bh=59O2/vXLnZE84AvohZq+18CKai09q70LbpaFTEkPOcE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dn6dRZ97kWGazDUq+t2eK0QSJ6GasSHtklk3Svsl/izs5rB941lcLeBl1b574pC0m+P1zRWQECKTqw/wr+/D8rabpvA6pELKwtw45YGSTZQv6w4XhMYJJUciSO7r+vM1C7KNpey1MKEvZx256quPzPAglVx4n8+ze4yYFcgkcZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VXFL19Zm; 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="VXFL19Zm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ECAAC19425; Fri, 24 Apr 2026 14:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041832; bh=59O2/vXLnZE84AvohZq+18CKai09q70LbpaFTEkPOcE=; h=From:To:Cc:Subject:Date:Reply-To:From; b=VXFL19ZmsFC2PiRUAOnWDLBq1iEEMJxne4ZDRPPOJy/V3vIrfX7BVdgpeS5QTOtMw D27OMjmXY0bMIlI8nrqdDW3lsc6H1MAPmadpl2wfUMwm1SA+USLRPK/Mc40BkyZSXD USDoGBB8eVvjngTxt9W0aj+COCq2vxFBwnBNKEl8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31589: mm: call ->free_folio() directly in folio_unmap_invalidate() Date: Fri, 24 Apr 2026 16:43:25 +0200 Message-ID: <2026042414-CVE-2026-31589-18ae@gregkh> X-Mailer: git-send-email 2.53.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=2210; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qTTIiJXTY8zP602QBy7PkoM5BHkQRanJEmJJ1c9vYUw=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvG5sCzSdu4KhimNupnRi2bJOUgr8b9xeFhI83pRYG8 1o8axLoiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIksMWFY0NwmfcIz+s9vj/js +VoG1xeoaD14wrBgm0XGJFOWTZerc3ZtKvPSa6qUSj4LAA== 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: call ->free_folio() directly in folio_unmap_invalidate() We can only call filemap_free_folio() if we have a reference to (or hold a lock on) the mapping. Otherwise, we've already removed the folio from the mapping so it no longer pins the mapping and the mapping can be removed, causing a use-after-free when accessing mapping->a_ops. Follow the same pattern as __remove_mapping() and load the free_folio function pointer before dropping the lock on the mapping. That lets us make filemap_free_folio() static as this was the only caller outside filemap.c. The Linux kernel CVE team has assigned CVE-2026-31589 to this issue. Affected and fixed versions =========================== Fixed in 6.19.14 with commit b667df39d98a7a24be7c2a40ff0863dac1ad2cd7 Fixed in 7.0.1 with commit c330e65ea59c4805d6ab6757c4ddfe8c63acef31 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-31589 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: mm/filemap.c mm/internal.h mm/truncate.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/b667df39d98a7a24be7c2a40ff0863dac1ad2cd7 https://git.kernel.org/stable/c/c330e65ea59c4805d6ab6757c4ddfe8c63acef31 https://git.kernel.org/stable/c/615d9bb2ccad42f9e21d837431e401db2e471195