[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_85467F89852EDEEEF58C8F67D446F592F106@qq.com>
Date: Sat, 23 Aug 2025 07:22:13 +0800
From: Edward Adam Davis <eadavis@...com>
To: eadavis@...com
Cc: asmadeus@...ewreck.org,
ericvh@...nel.org,
linux-kernel@...r.kernel.org,
linux_oss@...debyte.com,
lucho@...kov.net,
syzbot+30c83da54e948f6e9436@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com,
v9fs@...ts.linux.dev
Subject: [PATCH next V2] 9p: Correct the session info
syz report a shift-out-of-bounds in v9fs_get_tree.
This is because the maxdata value is 0, causing fls to return 32, meaning
the s_blocksize_bits value is 32, which causes an out of bounds error.
The root cause of this is incorrect session information obtained during
fill super. Since v9ses is stored in sb, it is used directly.
Fixes: 4d18c32a395d ("9p: convert to the new mount API")
Reported-by: syzbot+30c83da54e948f6e9436@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=30c83da54e948f6e9436
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
V1 -> V2: remove the unused ctx
fs/9p/vfs_super.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index f6065b5e0e5d..bcb6ebdb8037 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -49,8 +49,7 @@ static int v9fs_set_super(struct super_block *s, struct fs_context *fc)
static int v9fs_fill_super(struct super_block *sb, struct fs_context *fc)
{
int ret;
- struct v9fs_context *ctx = fc->fs_private;
- struct v9fs_session_info *v9ses = &ctx->v9ses;
+ struct v9fs_session_info *v9ses = sb->s_fs_info;
sb->s_maxbytes = MAX_LFS_FILESIZE;
sb->s_blocksize_bits = fls(v9ses->maxdata - 1);
--
2.43.0
Powered by blists - more mailing lists