Re: [syzbot] Re: [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write in bch2_dev_journal_init
From: syzbot
Date: Sun Aug 18 2024 - 23:02:51 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.
***
Subject: Re: [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write in bch2_dev_journal_init
Author: lizhi.xu@xxxxxxxxxxxxx
unsigned may overflow
#syz test: upstream c3f2d783a459
diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h
index 19183fcf7ad7..311a62a0f6c1 100644
--- a/fs/bcachefs/journal_types.h
+++ b/fs/bcachefs/journal_types.h
@@ -323,7 +323,7 @@ struct journal_device {
unsigned dirty_idx_ondisk;
unsigned dirty_idx;
unsigned cur_idx; /* Journal bucket we're currently writing to */
- unsigned nr;
+ u64 nr;
u64 *buckets;