Bug 2142718 - [virtio-win][virtiofs] Can't create file in folder with group write access
Summary: [virtio-win][virtiofs] Can't create file in folder with group write access
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virtio-win
Version: 9.2
Hardware: x86_64
OS: Windows
medium
medium
Target Milestone: rc
: ---
Assignee: Yvugenfi@redhat.com
QA Contact: xiagao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-15 04:24 UTC by xiagao
Modified: 2023-07-28 01:16 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 20:45:46 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-139346 0 None None None 2022-11-15 04:26:31 UTC

Description xiagao 2022-11-15 04:24:30 UTC
Description of problem:
Start a virtiofsd with the current user, but the shared folder belongs to another group and the curent user belongs to that group as well, try to create a file in the shared dir but failed.

Version-Release number of selected component (if applicable):
virtio-win-prewhql-0.1-228
qemu-kvm-7.1.0-3.el9.x86_64
5.14.0-178.el9.x86_64
edk2-ovmf-20220826gitba0e0e4c6a-1.el9.noarch

How reproducible:
100%

Steps to Reproduce:
1.Add two users on host
# useradd u1
# useradd u2
2.Change permission of u1 home directory
# chmod -R 777 u1
u1]# ll
total 8
-rwxrwx---. 1 u1 u1 2730 Nov 14 22:53 boot.sh
srwxrwx---. 1 u1 u1    0 Nov 14 22:52 sock1
-rwxrwx---. 1 u1 u1    7 Nov 14 22:52 sock1.pid
drwxrwx---. 3 u1 u1   41 Nov 14 22:55 test

3.Change user u2's supplementary group to u1
# usermod -G u1 u2
# id u2
uid=1002(u2) gid=1002(u2) groups=1002(u2),1001(u1)

4. switch to u2 and start virtiofsd
[root@dell-per440-06 u1]# su u2
[u2@dell-per440-06 u1]$ /usr/libexec/virtiofsd -o source=test --socket-path=sock1

5. start virtiofsd and ws2022 vm with user u2.
[u2@dell-per440-06 u1]$ /usr/libexec/virtiofsd -o source=test --socket-path=sock1

6. start virtiofs service in guest and get z: volume
7. try to create a file in guest

Actual results:
Failed and it shows "File too Large" .....(see attachment)

Expected results:
success to create file

Additional info:
1. Linux guest has different result in step7.
Be able to create file in shared dir.
# ll
-rw-r--r--. 1 u2 u1 5 Nov 15 2022 file.txt

2. Only creating files/folders failed, while modifying files worked.

Comment 4 Yvugenfi@redhat.com 2023-01-19 09:15:00 UTC
https://github.com/virtio-win/kvm-guest-drivers-windows/pull/873 - upstream PR

Comment 5 Viktor Prutyanov 2023-01-19 19:51:10 UTC
Added new parameters named OverflowUid and OverflowGid, they are always parsed from the registry. Normally, these parameters only affect if the host daemon is running inside a Linux user namespace. They denote UID and GID perceived as nobody on the host, so they should be in sync with corresponding host values. If the service finds out shared folder root owner UID/GID becomes nobody, it will try previous UID/GID as owner for new files and folders. They assumed to be 65534 if no such parameters are found in the registry.

Comment 7 xiagao 2023-02-01 08:04:55 UTC
Can reproduce with virtio-win-prewhql-0.1-231.
Test pass with virtio-win-prewhql-0.1-233.

So verify it.

Comment 10 Yash Mankad 2023-05-16 20:45:46 UTC
Fixed in RHEL 9.2.0 GA
CLOSING as CURRENTRELEASE


Note You need to log in before you can comment on or make changes to this bug.