[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c72cede4-34de-4e53-8ede-ff57b8f2f4f3@linux.alibaba.com>
Date: Wed, 20 Aug 2025 13:50:22 +0800
From: Joseph Qi <joseph.qi@...ux.alibaba.com>
To: Edward Adam Davis <eadavis@...com>, akpm <akpm@...ux-foundation.org>
Cc: jlbec@...lplan.org, linux-kernel@...r.kernel.org, mark@...heh.com,
ocfs2-devel@...ts.linux.dev,
syzbot+47d8cb2f2cc1517e515a@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH V2] ocfs2: prevent release journal inode after journal
shutdown
On 2025/8/19 21:41, Edward Adam Davis wrote:
> 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.
>
> Reported-by: syzbot+47d8cb2f2cc1517e515a@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=47d8cb2f2cc1517e515a
> Tested-by: syzbot+47d8cb2f2cc1517e515a@...kaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@...com>
Reviewed-by: Joseph Qi <joseph.qi@...ux.alibaba.com>
> ---
> V1 -> V2: Corrected typos and comments.
>
> fs/ocfs2/inode.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index 14bf440ea4df..6c4f78f473fb 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -1281,6 +1281,9 @@ static void ocfs2_clear_inode(struct inode *inode)
> * the journal is flushed before journal shutdown. Thus it is safe to
> * have inodes get cleaned up after journal shutdown.
> */
> + if (!osb->journal)
> + return;
> +
> jbd2_journal_release_jbd_inode(osb->journal->j_journal,
> &oi->ip_jinode);
> }
Powered by blists - more mailing lists