9p fails with readonly+non-root due to O_NOATIME

Bug #1091430 reported by Ben Jencks
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Serge Hallyn

Bug Description

http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg02053.html

Upstream QEMU commit: eed968607d656a218712df47a5e0432c21fd6994
hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode

When a 9p filesystem is exported with the readonly flag, QEMU adds the O_NOATIME flag to all accesses. This causes all reads to fail when qemu is run as non-root and the runas user doesn't own the files being accessed. The patch is a one-liner; please add it to the distribution patches.

Steps to reproduce:
1. Download ubuntu-12.04.1-desktop-amd64.iso
2. As a non-root user,

$ mkdir testdir
$ echo "value" > testdir/testfile
$ sudo chown -R root:root testdir

3. Start the VM, again as a non-root user:

$ qemu-system-x86_64 -cdrom /path/to/ubuntu-12.04.1-desktop-amd64.iso -vga std -m 2048 \
-fsdev local,id=foo,path=testdir,security_model=none,readonly \
-device virtio-9p-pci,fsdev=foo,mount_tag=foo

4. Inside the VM, select "Try Ubuntu", open a terminal, and run:

$ sudo mount -t 9p -o trans=virtio,version=9p2000.L,ro foo /mnt
$ ls /mnt
testfile
$ cat /mnt/testfile

Expected results:
value

Actual results:
cat: /mnt/testfile: operation not permitted

=======================
SRU Justification:
1. Impact: cannot use 9p fs in ro mode as nonroot.
2. Development fix: a patch upstream fixes the attempt to use a flag which only root may use (when not needed)
3. Stable fix: cherrypick of development fix
4. Test case: detailed above
5. Regression potential: this patch only affects 9pfs, and is cherrypicked from upstream, so should have no adverse effect on any other qemu code.
======================

Revision history for this message
Ben Jencks (bjencks) wrote :

This is for precise only. I believe quantal and newer include versions fixed upstream.

Changed in qemu-kvm (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. In order to SRU this fix to precise, we'll need a very simple and detailed test case (so that people not familiar with 9p use on qemu can test it). Could you please document in a comment or the description an exact set of commands (including all options) which should succeed with the fix?

tags: added: sru
Changed in qemu-kvm (Ubuntu Precise):
importance: Undecided → High
status: New → Confirmed
Changed in qemu-kvm (Ubuntu):
status: Confirmed → Fix Released
Ben Jencks (bjencks)
description: updated
Revision history for this message
Ben Jencks (bjencks) wrote :

The description was updated; are the described procedure and expected/actual results appropriate?

Changed in qemu-kvm (Ubuntu Precise):
assignee: nobody → Serge Hallyn (serge-hallyn)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ben, or anyone else affected,

Accepted qemu-kvm into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/qemu-kvm/1.0+noroms-0ubuntu14.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in qemu-kvm (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Ben Jencks (bjencks) wrote :

Confirmed using test procedure in description that the issue is resolved in 1.0+noroms-0ubuntu14.8.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 1.0+noroms-0ubuntu14.8

---------------
qemu-kvm (1.0+noroms-0ubuntu14.8) precise-proposed; urgency=low

  * qemu-utils.links: fix kvm-nbd.8.gz and kvm-img.1.gz symlinks. (LP: #1089402)
  * take 9pfs-remove-noatime-flag-from-ro-open-calls.patch from upstream git
    to make readonly+nonroot 9p mounts succeed. (LP: #1091430)
 -- Serge Hallyn <email address hidden> Tue, 29 Jan 2013 22:41:42 -0600

Changed in qemu-kvm (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.