Re: [syzbot] [v9fs?] UBSAN: shift-out-of-bounds in v9fs_get_tree

Yuichiro Tsuji
2025-08-22T13:46:04Z

#syz test

diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 795c6388744c..3947ef762aaa 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -59,7 +59,7 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, int flags)
sb->s_maxbytes = MAX_LFS_FILESIZE;
sb->s_blocksize_bits = fls(v9ses->maxdata - 1);
- sb->s_blocksize = 1 << sb->s_blocksize_bits;
+ sb->s_blocksize = BIT(sb->s_blocksize_bits);
sb->s_magic = V9FS_MAGIC;
if (v9fs_proto_dotl(v9ses)) {
sb->s_op = &v9fs_super_ops_dotl;