Re: [syzbot] Re: [syzbot] [bcachefs?] KASAN: slab-use-after-free Read in bch2_reconstruct_alloc
From: syzbot
Date: Thu Oct 24 2024 - 02:45:56 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.
***
Subject: Re: [syzbot] [bcachefs?] KASAN: slab-use-after-free Read in bch2_reconstruct_alloc
Author: lizhi.xu@xxxxxxxxxxxxx
sb is changed?
#syz test: upstream master
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 55e1504a8130..b9a3a8e6acd9 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -95,6 +95,7 @@ static void bch2_reconstruct_alloc(struct bch_fs *c)
c->sb.compat &= ~(1ULL << BCH_COMPAT_alloc_info);
bch2_write_super(c);
+ ext = bch2_sb_field_get(c->disk_sb.sb, ext);
mutex_unlock(&c->sb_lock);
c->opts.recovery_passes |= bch2_recovery_passes_from_stable(le64_to_cpu(ext->recovery_passes_required[0]));