mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Tinguely <mark.tinguely@oracle.com>
To: Edward Adam Davis <eadavis@qq.com>
Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	linux-kernel@vger.kernel.org, mark@fasheh.com,
	ocfs2-devel@lists.linux.dev,
	syzbot+47d8cb2f2cc1517e515a@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [External] : [PATCH V2] ocfs2: prevent release journal inode after journal shutdown
Date: Tue, 19 Aug 2025 09:17:40 -0500	[thread overview]
Message-ID: <a365b3cd-b1b5-4d04-9877-129286345ce0@oracle.com> (raw)
In-Reply-To: <tencent_357489BEAEE4AED74CBD67D246DBD2C4C606@qq.com>

On 8/19/25 8:41 AM, 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@syzkaller.appspotmail.com
> Closes: https://urldefense.com/v3/__https://syzkaller.appspot.com/bug?extid=47d8cb2f2cc1517e515a__;!!ACWV5N9M2RV99hQ!IR4Z9VG7eJItxQAEk4-F5EMvtDaSRSvdmdcMeFjajaLLqAc2Vk9HICGKkI-geAk8gYlrJzH-UEfJuaJ2kw$
> Tested-by: syzbot+47d8cb2f2cc1517e515a@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.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);
>   }


fixes commit da5e7c87827e8caa6a1eeec6d95dcf74ab592a01 
(v5.15-5-gda5e7c87827). Also for the stable branch?

Reviewed-by: Mark Tinguely <mark.tinguely@oracle.com>

  reply	other threads:[~2025-08-19 14:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 11:34 [syzbot] [ocfs2?] general protection fault in ocfs2_evict_inode (2) syzbot
2025-08-19 13:09 ` Edward Adam Davis
2025-08-19 13:32   ` syzbot
2025-08-19 13:32 ` [PATCH] ocfs2: prevent release journal inode after journal shutdown Edward Adam Davis
2025-08-19 13:41   ` [PATCH V2] " Edward Adam Davis
2025-08-19 14:17     ` Mark Tinguely [this message]
2025-08-20  1:01       ` [External] : " Edward Adam Davis
2025-08-20  5:50     ` Joseph Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a365b3cd-b1b5-4d04-9877-129286345ce0@oracle.com \
    --to=mark.tinguely@oracle.com \
    --cc=eadavis@qq.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=syzbot+47d8cb2f2cc1517e515a@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®