All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+1a8e2b31f2ac9bd3d148@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [f2fs?] KASAN: null-ptr-deref Write in f2fs_stop_gc_thread
Date: Wed, 24 Jul 2024 18:32:49 -0700	[thread overview]
Message-ID: <00000000000069d6d4061e085f82@google.com> (raw)
In-Reply-To: <0000000000005c7ccb061e032b9b@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [f2fs?] KASAN: null-ptr-deref Write in f2fs_stop_gc_thread
Author: lizhi.xu@windriver.com

shutting down f2fs set ro, and check bdev_thaw return value

#syz test: upstream 2c9b3512402e

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index c1ad9b278c47..0e607cb3bc9a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2244,7 +2244,9 @@ int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,
 		if (ret)
 			goto out;
 		f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_SHUTDOWN);
-		bdev_thaw(sb->s_bdev);
+		ret = bdev_thaw(sb->s_bdev);
+		if (ret == -EINVAL)
+			goto out;
 		break;
 	case F2FS_GOING_DOWN_METASYNC:
 		/* do checkpoint only */
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index df4cf31f93df..e507379762ff 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4177,7 +4177,7 @@ void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
 	 * RO by shutdown, since RO bypasses thaw_super which can hang the
 	 * system.
 	 */
-	if (continue_fs || f2fs_readonly(sb) || shutdown) {
+	if (continue_fs || f2fs_readonly(sb)) {
 		f2fs_warn(sbi, "Stopped filesystem due to reason: %d", reason);
 		return;
 	}

  reply	other threads:[~2024-07-25  1:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 19:20 [f2fs-dev] [syzbot] [f2fs?] KASAN: null-ptr-deref Write in f2fs_stop_gc_thread syzbot
2024-07-24 19:20 ` syzbot
2024-07-25  1:32 ` syzbot [this message]
2024-07-25  2:21 ` [syzbot] " syzbot
2024-07-25  5:08 ` syzbot
2024-07-25  7:27 ` syzbot
2024-07-25  8:08 ` syzbot
2024-07-25 12:49 ` syzbot
2024-07-25 13:19 ` syzbot
2024-07-25 13:53 ` syzbot
2024-07-26 11:08 ` Edward Adam Davis
2024-07-26 17:02   ` syzbot
2024-07-27  2:08 ` Edward Adam Davis
2024-07-27  2:48   ` syzbot
2024-07-27  3:38 ` Edward Adam Davis
2024-07-27  4:01   ` syzbot
2024-07-27  4:07 ` Edward Adam Davis
2024-07-27  5:13   ` syzbot
2024-07-27  5:56 ` [f2fs-dev] [PATCH] f2fs: Add mutex to prevent gc task from being accessed before initialization Edward Adam Davis via Linux-f2fs-devel
2024-07-27  5:56   ` Edward Adam Davis

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=00000000000069d6d4061e085f82@google.com \
    --to=syzbot+1a8e2b31f2ac9bd3d148@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.