From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+594427aebfefeebe91c6@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in rewrite_old_nodes_pred
Date: Mon, 6 May 2024 19:34:55 +0800 [thread overview]
Message-ID: <tencent_8FCF868D9725D00DF592245DE4DD86997807@qq.com> (raw)
In-Reply-To: <0000000000000498630617b740d3@google.com>
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));
next prev parent reply other threads:[~2024-05-06 11:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 16:14 syzbot
2024-05-06 1:04 ` [syzbot] " syzbot
2024-05-06 11:34 ` Edward Adam Davis [this message]
2024-05-06 12:08 ` syzbot
2024-05-07 19:11 ` syzbot
[not found] <20240506010441.1627271-1-lizhi.xu@windriver.com>
2024-05-06 1:34 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_8FCF868D9725D00DF592245DE4DD86997807@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+594427aebfefeebe91c6@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®