qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 655120] Re: VirtFS EFAULT when accessing not existing


From: James Morse
Subject: [Qemu-devel] [Bug 655120] Re: VirtFS EFAULT when accessing not existing files
Date: Wed, 27 Oct 2010 13:36:48 -0000

Reproducible here with guest kernel 2.6.36 built for i686 and qemu-kvm built 
from a fresh git clone taken on 27/10/2010.
Host kernel is 2.6.30.10105.2.23.fc11.i686.PAE
Guest 9p filesystem mounted as both 9p2000.u and 9p2000.L with the same problem.

In the guest syscall 'stat' on a non-existent path returns EFAULT (bad address) 
instead of ENOENT.
This also affects syscall 'open', and is preventing new files from being 
created.

I believe this is caused by 'v9fs_vfs_lookup' in 'fs/9p/vfs_inode.c' returning 
EFAULT instead of ENOENT.
'p9_client_walk' also returns EFAULT instead of ENOENT.
Eventually we get to 'pdu_read' in 'net/9p/protocol.c', which is being called 
to read '4 bytes', but calculates the space left in the 'pdu' (offset:10 
size:11) as being 1. This call returns '3' (presumably how many bytes are left 
unread). 
In this case it gets back to 9pdu_vreadf, on line 178, (reading a 'd' 32bit 
integer), which sets EFAULT as the error code.

This then propagates all the way back to vfs.


This looks to me like a short-read, but I don't know enough about the plan9 
filesystem protocol to be able to debug this further.


** Attachment added: "Stack trace from pdu_read"
   
https://bugs.launchpad.net/qemu/+bug/655120/+attachment/1713038/+files/9p_shortread_stacktrace.txt

-- 
VirtFS EFAULT when accessing not existing files
https://bugs.launchpad.net/bugs/655120
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
 use as client Debian squeeze i386 with a custom kernel:
Linux (none) 2.6.35.5 #3 Thu Sep 23 18:36:02 UTC 2010 i686 GNU/Linux

And as host Debian squeeze amd64
Linux asd 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux

kvm version is:
kvm-88-5908-gdd67374

Started the client using:
sudo /usr/local/kvm/bin/qemu-system-x86_64 -m 1024 -kernel linux-2.6.35.5.qemu 
-drive file=root.img,if=virtio -net 
nic,macaddr=02:ca:ff:ee:ba:be,model=virtio,vlan=1 -net 
tap,ifname=tap1,vlan=1,script=no -virtfs 
local,path=/host,security_model=mapped,mount_tag=host -nographic

I've done following inside the guest:
$ mount -t 9p -o trans=virtio,version=9p2000.L host /mnt
$ ls -l /mnt/not-existing
ls: cannot access /mnt/not-existing: Bad address

This does not happen when not using 9p2000.L
$ mount -t 9p -o trans=virtio host /mnt
$ ls -l /mnt/not-existing
ls: cannot access /mnt/not-existing: No such file or directory

This return code will for example break make or many other tools.
$ echo $PATH
/mnt/usr/bin:/mnt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ make KERNELDIR=/usr/src/linux
make: execvp: pwd: Bad address
Makefile:54: /Makefile.linux: No such file or directory
make: *** No rule to make target `/Makefile.linux'.  Stop.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]