ocfs2: fix null-ptr-deref when journal load failed.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f6f50e28f0cb8d7bcdfaacc83129f005dede11b1 · < 86a89e75e9e4dfa768b97db466ad6bedf2e7ea5b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix null-ptr-deref when journal load failed.
During the mounting process, if journal_reset() fails because of too short journal, then lead to jbd2_journal_load() fails with NULL j_sb_buffer. Subsequently, ocfs2_journal_shutdown() calls jbd2_journal_flush()->jbd2_cleanup_journal_tail()-> __jbd2_update_log_tail()->jbd2_journal_update_sb_log_tail() ->lock_buffer(journal->j_sb_buffer), resulting in a null-pointer dereference error.
To resolve this issue, we should check the JBD2_LOADED flag to ensure the journal was properly loaded. Additionally, use journal instead of osb->journal directly to simplify the code.
From the CVE record · Linux
The Linux kernel's ocfs2 code can dereference a null pointer during journal shutdown if a too-short journal causes journal loading to fail while mounting a filesystem. The input does not establish whether an attacker can trigger this, or specify authentication or user-interaction requirements.
Engineers running Linux systems that mount OCFS2 filesystems should check their kernel version; affected versions are not specified.