id = 1066 title = "virtfs fails to access contents of non-readable directories" state = "opened" created_at = "2022-06-06T14:50:03.134Z" closed_at = "n/a" labels = ["block:9p"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1066" host-os = "Linux Gentoo" host-arch = "x86_64" qemu-version = "7.0.0" guest-os = "Linux" guest-arch = "x86_64" description = """Attempting to access a directory inside a non-readable directory via virtfs fails.""" reproduce = """On host: 1. `mkdir -p test/foo/bar` 2. `echo hello world >test/foo/bar/baz.txt` 3. `chmod -r test/foo` The following works on host: ``` $ ls test foo $ ls test/foo ls: cannot open directory 'test/foo': Permission denied $ ls test/foo/bar baz.txt ``` However on guest: ``` bash-5.1# ls /test/ foo bash-5.1# ls /test/foo/ ls: cannot open directory '/test/foo/': Permission denied bash-5.1# ls /test/foo/bar/ ls: cannot access '/test/foo/bar/': Permission denied ```""" additional = """I am guessing virtfs attempts to check rights (via access?) on the directory itself when obtaining an inode to give to the guest, however not having read access doesn't mean something can't be executed, especially for directories."""