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 5010D3DE42C for ; Fri, 24 Apr 2026 14:44: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=1777041897; cv=none; b=eojEbje3alejg2vl7Wle7lOwp9vCJKbHqzRQfwWGqidq0+AFFoQnLgzJxpQH5WNVdNus1UbEiCN9fIZu13HJAbrGiII8bb7WNFPne9yHRBbqxINdW0aiZV+pTfkzwVdtg0ISPxxdWyi/4CicnX3iOhDkePs5V3gvdYXdCBashEA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041897; c=relaxed/simple; bh=QvGcjFXvVSItE6ocVmjvwJTLkiV5YY7LO9pfSh3Ous4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d88u+QYfVImqClqt7plUYzGu3Ij4QR5hqEhvEywzFO2+jK3eA3qjVD6dpkZREp1JabZ/GLNV9UuDBdIZ75dUuup47GNOwkgtwwXZqKhMtB4o/+rIS0c2N+b6AeqcscjXl7wUaJN4mD9HurBkU8j+G9PqsyGQBbdHlhzgLXS8LEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cNsPfdmq; 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="cNsPfdmq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 918F9C2BCB2; Fri, 24 Apr 2026 14:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041896; bh=QvGcjFXvVSItE6ocVmjvwJTLkiV5YY7LO9pfSh3Ous4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=cNsPfdmq+JqPYKZwH4ElB4uci4D69CV7B4q33g9bF8IPKF0/UUqdEFoRHAYn7alfO Y0kFNJkQSEi+zY73de7Qi/kDIcVQNJ5kZLT+kJ0AlHjCU4MGESyhlYzjZk7gxfXGDI I5Xm1YAghyoHz/kDR/RsOL8cPEVH2VS9ARQCJwHI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31597: ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY Date: Fri, 24 Apr 2026 16:43:33 +0200 Message-ID: <2026042417-CVE-2026-31597-79cd@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=2772; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iJVoYIkaS7aSzhZyanQrwAyBsHBc4cYDvdYHy0aQTb8=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvG1snltpGNMjqrq4svVt/+VvX3DjljUerp0ae8/y2N tXXfodIRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExEUZhhQYffxZmpYYItZ5bI lvIsuigYOOtrA8N8Z+0dPBuPs2wXyDx3JoH586FZCUc0AA== 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: ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY filemap_fault() may drop the mmap_lock before returning VM_FAULT_RETRY, as documented in mm/filemap.c: "If our return value has VM_FAULT_RETRY set, it's because the mmap_lock may be dropped before doing I/O or by lock_folio_maybe_drop_mmap()." When this happens, a concurrent munmap() can call remove_vma() and free the vm_area_struct via RCU. The saved 'vma' pointer in ocfs2_fault() then becomes a dangling pointer, and the subsequent trace_ocfs2_fault() call dereferences it -- a use-after-free. Fix this by saving ip_blkno as a plain integer before calling filemap_fault(), and removing vma from the trace event. Since ip_blkno is copied by value before the lock can be dropped, it remains valid regardless of what happens to the vma or inode afterward. The Linux kernel CVE team has assigned CVE-2026-31597 to this issue. Affected and fixed versions =========================== Fixed in 6.12.83 with commit 4cf2768a0291a0cdd0dae801ea0eafa3878a349d Fixed in 6.18.24 with commit d45ff441b416d4aa1af72b1db23d959601c04da2 Fixed in 6.19.14 with commit 76a602fdbb78dd05b2da06f74a988cebc97e82d0 Fixed in 7.0.1 with commit 925bf22c1b823e231b1baea761fe8a1512e442f2 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-31597 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: fs/ocfs2/mmap.c fs/ocfs2/ocfs2_trace.h 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/4cf2768a0291a0cdd0dae801ea0eafa3878a349d https://git.kernel.org/stable/c/d45ff441b416d4aa1af72b1db23d959601c04da2 https://git.kernel.org/stable/c/76a602fdbb78dd05b2da06f74a988cebc97e82d0 https://git.kernel.org/stable/c/925bf22c1b823e231b1baea761fe8a1512e442f2 https://git.kernel.org/stable/c/7de554cabf160e331e4442e2a9ad874ca9875921