In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix null-ptr-deref when journal load failed.
During the mounting process, if journalreset() fails because of too short journal, then lead to jbd2journalload() fails with NULL jsbbuffer. Subsequently, ocfs2journalshutdown() calls jbd2journalflush()->jbd2cleanupjournaltail()-> _jbd2updatelogtail()->jbd2journalupdatesblogtail() ->lockbuffer(journal->jsbbuffer), 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.