mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+30c83da54e948f6e9436@syzkaller.appspotmail.com
Cc: asmadeus@codewreck.org, ericvh@kernel.org,
	linux-kernel@vger.kernel.org, linux_oss@crudebyte.com,
	lucho@ionkov.net, syzkaller-bugs@googlegroups.com,
	v9fs@lists.linux.dev
Subject: [PATCH next] 9p: Correct the session info
Date: Fri, 22 Aug 2025 22:41:06 +0800	[thread overview]
Message-ID: <tencent_074BFE748F778366103D0B36E0971837E809@qq.com> (raw)
In-Reply-To: <68a68b57.050a0220.3d78fd.0012.GAE@google.com>

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@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=30c83da54e948f6e9436
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 fs/9p/vfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index f6065b5e0e5d..cc2056dd0bef 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -50,7 +50,7 @@ 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


  parent reply	other threads:[~2025-08-22 14:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21  2:58 [syzbot] [v9fs?] UBSAN: shift-out-of-bounds in v9fs_get_tree syzbot
2025-08-21  3:48 ` Dominique Martinet
2025-08-21  4:06   ` syzbot
2025-09-24 23:14   ` Eric Sandeen
2025-08-21  8:47 ` Hillf Danton
2025-08-21  9:23   ` syzbot
2025-08-22 13:31     ` Yuichiro Tsuji
2025-08-22 14:56       ` syzbot
2025-08-22 13:45     ` Yuichiro Tsuji
2025-08-22 17:47       ` syzbot
2025-08-22 14:27 ` Edward Adam Davis
2025-08-22 18:05   ` syzbot
2025-08-22 14:41 ` Edward Adam Davis [this message]
2025-08-22 23:22   ` [PATCH next V2] 9p: Correct the session info Edward Adam Davis
2025-08-23  6:34     ` Dominique Martinet
2025-09-24 22:19       ` Eric Sandeen
2025-09-25  2:17         ` Dominique Martinet
2025-09-25  4:29           ` Eric Sandeen
2025-09-25  7:24             ` Dominique Martinet
2025-09-28  4:00 ` Forwarded: Re: [syzbot] [v9fs?] UBSAN: shift-out-of-bounds in v9fs_get_tree syzbot
2025-09-28 19:04 ` 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_074BFE748F778366103D0B36E0971837E809@qq.com \
    --to=eadavis@qq.com \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=syzbot+30c83da54e948f6e9436@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=v9fs@lists.linux.dev \
    /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®