Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[virtiofs] Self-symlink causes crash in virtiofs share #1149

Open
Sirius902 opened this issue Sep 15, 2024 · 3 comments
Open

[virtiofs] Self-symlink causes crash in virtiofs share #1149

Sirius902 opened this issue Sep 15, 2024 · 3 comments
Assignees

Comments

@Sirius902
Copy link

Describe the bug
Opening a mounted virtiofs share in Windows Explorer with a self-symlink inside will cause the guest's virtiofs driver to crash.

To Reproduce
Steps to reproduce the behaviour:

  • On the host create a new directory, cd into it, and create a self-symlink in it with ln -s bruh bruh.
  • Share the directory with a Windows vm guest using virtiofs.
  • Mount the virtiofs share to a drive (here's my script for reference).
& "C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsZ VMShared \\.\Z:
  • In Windows Explorer open the drive mounted with virtiofs (in my case drive Z) and the virtiofs driver will crash.

Expected behavior
I would expect the virtiofs driver not to crash and possibly show the offending self-symlink as a shortcut.

Screenshots
image
image

Event Viewer error text:

Faulting application name: virtiofs.exe, version: 0.0.0.0, time stamp: 0x66952d29
Faulting module name: ntdll.dll, version: 10.0.22621.4111, time stamp: 0x518e67bb
Exception code: 0xc00000fd
Fault offset: 0x000000000002145a
Faulting process id: 0x0x1E28
Faulting application start time: 0x0x1DB07A4D7DEDDB8
Faulting application path: C:\Program Files\Virtio-Win\VioFS\virtiofs.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: bab05ad6-1799-40c1-894d-9ae2ca09894e
Faulting package full name: 
Faulting package-relative application ID: 

Host:

  • Disto: NixOS
  • Kernel version: Linux 6.10.9

VM:

  • Windows version: Windows 11 22631.4169
  • Which driver has a problem: virtiofs.exe
  • Driver version or commit hash that was used to build the driver: Virtio-win-guest-tools 0.1.262
@YanVugenfirer
Copy link
Collaborator

Thank you for reporting the issue!

Symlinks are a known place for the corner cases due to the different handling by Linux and Windows.
We will look into this, but unfortunately not in a very near future

@xiagao
Copy link

xiagao commented Sep 18, 2024

@Sirius902 I didn't reproduce this issue in my env with your steps, could you tell the virtiofsd version?
Host/guest info:
5.14.0-494.el9.x86_64
virtiofsd-1.11.1-1.el9.x86_64
virtio-win-prewhql-0.1-262
Win11 23h3(os build 22631.3447)

Steps:

  1. Create virtiofsd with root privilege:
mkdir /root/avocado/data/avocado-vt/virtio_fs_test/ &
/usr/libexec/virtiofsd --socket-path=/var/tmp/avocado-vt-vm1-fs-virtiofsd.sock -o source=/root/avocado/data/avocado-vt/virtio_fs_test/ -o cache=auto &
  1. Create a symlink for a file
ln -s tmp.sh tmp-link.sh
lrwxrwxrwx 1 root root        6 Sep 18 08:34  tmp-link.sh -> tmp.sh
  1. Start Win11 guest and start virtiofs service.
C:\>"C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs C:\virtiofs.exe "-t %1 -m %2"
The operation completed successfully.
The operation completed successfully.
The operation completed successfully.

C:\>"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs xiagao_fs1 myfs Y:
OK
  1. Opening the mounted virtiofs share in Windows Explorer, in my case it is Y: volume.

Results: No driver crash.
image

@xiagao
Copy link

xiagao commented Sep 18, 2024

Ignore my last comment. It wasn't for self-symlink.
The self-symlink indeed makes the virtiofs volume crash inside guest.
I'll create an internal issue to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants