[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_8FCF868D9725D00DF592245DE4DD86997807@qq.com>
Date: Mon, 6 May 2024 19:34:55 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+594427aebfefeebe91c6@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in rewrite_old_nodes_pred
please test oob in rewrite_old_nodes_pred
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7367539ad4b0
diff --git a/fs/bcachefs/bkey.c b/fs/bcachefs/bkey.c
index 76e79a15ba08..1b2cb956b2e0 100644
--- a/fs/bcachefs/bkey.c
+++ b/fs/bcachefs/bkey.c
@@ -577,7 +577,7 @@ static void set_format_field(struct bkey_format *f, enum bch_bkey_fields i,
unsigned unpacked_bits = bch2_bkey_format_current.bits_per_field[i];
u64 unpacked_max = ~((~0ULL << 1) << (unpacked_bits - 1));
- bits = min(bits, unpacked_bits);
+ bits = min3(bits, unpacked_bits, 63);
offset = bits == unpacked_bits ? 0 : min(offset, unpacked_max - ((1ULL << bits) - 1));
Powered by blists - more mailing lists