Skip to contentSkip to conversation

CVE-2025-39842: ocfs2: prevent release journal inode after journal shutdown

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 19, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

ocfs2: prevent release journal inode after journal shutdown

Before calling ocfs2_delete_osb(), ocfs2_journal_shutdown() has already been executed in ocfs2_dismount_volume(), so osb->journal must be NULL. Therefore, the following calltrace will inevitably fail when it reaches jbd2_journal_release_jbd_inode().

ocfs2_dismount_volume()->
ocfs2_delete_osb()->

    ocfs2_free_slot_info()->
      __ocfs2_free_slot_info()->
        evict()->
          ocfs2_evict_inode()->
            ocfs2_clear_inode()->
	      jbd2_journal_release_jbd_inode(osb->journal->j_journal,

Adding osb->journal checks will prevent null-ptr-deref during the above execution path.

The Linux kernel CVE team has assigned CVE-2025-39842 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.16 with commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 and fixed in 6.1.151 with commit 42c415c53ad2065088cc411d08925effa5b3d255
	Issue introduced in 5.16 with commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 and fixed in 6.6.105 with commit e9188f66e94955431ddbe2cd1cdf8ff2bb486abf
	Issue introduced in 5.16 with commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 and fixed in 6.12.46 with commit f4a917e6cd6c798f7adf39907f117fc754db1283
	Issue introduced in 5.16 with commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 and fixed in 6.16.6 with commit 85e66331b60601d903cceaf8c10a234db863cd78
	Issue introduced in 5.16 with commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 and fixed in 6.17-rc5 with commit f46e8ef8bb7b452584f2e75337b619ac51a7cadf

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-39842

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/inode.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/42c415c53ad2065088cc411d08925effa5b3d255
	https://git.kernel.org/stable/c/e9188f66e94955431ddbe2cd1cdf8ff2bb486abf
	https://git.kernel.org/stable/c/f4a917e6cd6c798f7adf39907f117fc754db1283
	https://git.kernel.org/stable/c/85e66331b60601d903cceaf8c10a234db863cd78
	https://git.kernel.org/stable/c/f46e8ef8bb7b452584f2e75337b619ac51a7cadf