Skip to content

virtio_fs: read the vring size under virtio_fs_mutex in ->get_tree - #2663

Open
vfsci-bot[bot] wants to merge 1 commit into
vfs.base.cifrom
pw/1171101/vfs.base.ci
Open

vfsci-bot[bot] wants to merge 1 commit into
vfs.base.cifrom
pw/1171101/vfs.base.ci

Conversation

@vfsci-bot

@vfsci-bot vfsci-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1171101
Submitter: Fan Wu
Version: 1
Patches: 1/1
Message-ID: <20260922081318.321686-1-fanwu01@zju.edu.cn>
Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260922081318.321686-1-fanwu01@zju.edu.cn


Automated by ml2pr

The vring size was read after virtio_fs_find_instance() had dropped
virtio_fs_mutex, so a concurrent virtio_fs_remove() could free the
virtqueue first. The reference from the lookup keeps the virtio_fs
alive, but not its virtqueues.

Hold the mutex across the lookup and the read.

This issue was found by an in-house static analysis tool.

Fixes: a7f0d7a ("virtiofs: split requests that exceed virtqueue size")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6
Co-developed-by: Song Li <songl@zju.edu.cn>
Signed-off-by: Song Li <songl@zju.edu.cn>
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants