lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <njvsgnfvwy3jwoy3zu23jp4365sp7aedqyllnf2efvqk44wr53@nuzknq3f7cem>
Date: Thu, 17 Jul 2025 17:21:28 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: syzbot <syzbot+6d52ee9afea131b36348@...kaller.appspotmail.com>
Cc: linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org, 
	syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [bcachefs?] WARNING in bch2_dev_free (2)

On Thu, Jul 17, 2025 at 12:13:33PM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    e8352908bdcd Add linux-next specific files for 20250716
> git tree:       linux-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=156f67d4580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=2594af20939db736
> dashboard link: https://syzkaller.appspot.com/bug?extid=6d52ee9afea131b36348
> compiler:       Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11a2158c580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=138bc58c580000

regression from

bcachefs: Fix __bch2_fs_read_write() error path

fixed by

(mark dirty before we start the write refcounts)

commit 212c9b90f9915058b4d98210660daa10860b124b
Author: Kent Overstreet <kent.overstreet@...ux.dev>
Date:   Thu Jul 17 16:11:38 2025 -0400

    fixup! bcachefs: Fix __bch2_fs_read_write() error path

diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 4e038f655f83..0fc0b2221036 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -514,6 +514,10 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early)
 	if (ret)
 		return ret;
 
+	ret = bch2_fs_mark_dirty(c);
+	if (ret)
+		return ret;
+
 	clear_bit(BCH_FS_clean_shutdown, &c->flags);
 
 	scoped_guard(rcu)
@@ -537,10 +541,6 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early)
 		bch2_journal_space_available(&c->journal);
 	}
 
-	ret = bch2_fs_mark_dirty(c);
-	if (ret)
-		return ret;
-
 	/*
 	 * Don't jump to our error path, and call bch2_fs_read_only(), unless we
 	 * successfully marked the filesystem dirty

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ