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] [day] [month] [year] [list]
Message-ID: <npvjcsr62mknglu6fp222ga7zmsqzewtrbiuvpuup2s5omu77y@ef6vk35ubzpi>
Date: Thu, 4 Jul 2024 21:18:49 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Lizhi Xu <lizhi.xu@...driver.com>
Cc: syzbot+8996d8f176cf946ef641@...kaller.appspotmail.com, 
	bfoster@...hat.com, linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org, 
	syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] bcachefs: fix hung in bch2_fs_read_only_work

On Mon, Jul 01, 2024 at 10:36:06PM GMT, Lizhi Xu wrote:
> Error logs:
> [ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
> [ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
> [ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
> 
> When hit -BCH_ERR_fsck_errors_not_fixed in journal_entry_err, it will make
> journal_entry_btree_keys_validate output too many same error log, and it will block
> bch2_fs_start to release state_lock.
> 
> Reported-and-tested-by: syzbot+8996d8f176cf946ef641@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
> Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
> ---
>  fs/bcachefs/journal_io.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
> index 492426c8d869..67c3f09162e4 100644
> --- a/fs/bcachefs/journal_io.c
> +++ b/fs/bcachefs/journal_io.c
> @@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c,
>  					       flags|BCH_VALIDATE_journal);
>  		if (ret == FSCK_DELETED_KEY)
>  			continue;
> +		else if (ret == -BCH_ERR_fsck_errors_not_fixed)
> +			break;

Actually, this is wrong: we need to return the error


commit b2879202fa55861d05088bbffdb529cf5d5ba7f8
Author: Kent Overstreet <kent.overstreet@...ux.dev>
Date:   Thu Jul 4 21:18:06 2024 -0400

    bcachefs: Fix missing error check in journal_entry_btree_keys_validate()
    
    Closes: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
    Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>

diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 40ed7a619594..7a833a3f1c63 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c,
 					       flags|BCH_VALIDATE_journal);
 		if (ret == FSCK_DELETED_KEY)
 			continue;
+		else if (ret)
+			return ret;
 
 		k = bkey_next(k);
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ