qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-iotests 232 fails when running the test as root user
@ 2018-11-29 21:03 Farhan Ali
  2018-11-29 21:07 ` Eric Blake
  0 siblings, 1 reply; 4+ messages in thread
From: Farhan Ali @ 2018-11-29 21:03 UTC (permalink / raw)
  To: qemu-block, QEMU Developers, Kevin Wolf, Eric Blake

Hi,

I am seeing a failure of the qemu-iotest number 232 when running the 
test as a root user. Is this the expected behavior?

Here is the output of the failure:

sudo ./check -qcow2 232

QEMU          -- 
"/home/alifm/kvmdev/qemu/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64" 
-nodefaults -machine accel=qtest
QEMU_IMG      -- 
"/home/alifm/kvmdev/qemu/tests/qemu-iotests/../../qemu-img"
QEMU_IO       -- 
"/home/alifm/kvmdev/qemu/tests/qemu-iotests/../../qemu-io"  --cache 
writeback -f qcow2
QEMU_NBD      -- 
"/home/alifm/kvmdev/qemu/tests/qemu-iotests/../../qemu-nbd"
IMGFMT        -- qcow2 (compat=1.1)
IMGPROTO      -- file
PLATFORM      -- Linux/x86_64 alifm-ThinkPad-T470p 4.10.0-40-generic
TEST_DIR      -- /home/alifm/kvmdev/qemu/tests/qemu-iotests/scratch
SOCKET_SCM_HELPER -- 
/home/alifm/kvmdev/qemu/tests/qemu-iotests/socket_scm_helper

232 1s ... - output mismatch (see 232.out.bad)
--- /home/alifm/kvmdev/qemu/tests/qemu-iotests/232.out	2018-11-26 
11:45:58.368023999 -0500
+++ /home/alifm/kvmdev/qemu/tests/qemu-iotests/232.out.bad	2018-11-29 
15:58:41.768561694 -0500
@@ -21,13 +21,13 @@
  NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
  NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)

-QEMU_PROG: -drive 
driver=file,file=TEST_DIR/t.IMGFMT,if=none,read-only=off,auto-read-only=off: 
Could not open 'TEST_DIR/t.IMGFMT': Permission denied
-NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
-NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
-
-QEMU_PROG: -drive 
driver=file,file=TEST_DIR/t.IMGFMT,if=none,auto-read-only=off: Could not 
open 'TEST_DIR/t.IMGFMT': Permission denied
-NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
-NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
+NODE_NAME: TEST_DIR/t.IMGFMT (file)
+NODE_NAME: TEST_DIR/t.IMGFMT (file)
+NODE_NAME: TEST_DIR/t.IMGFMT (file)
+
+NODE_NAME: TEST_DIR/t.IMGFMT (file)
+NODE_NAME: TEST_DIR/t.IMGFMT (file)
+NODE_NAME: TEST_DIR/t.IMGFMT (file)

  === -blockdev with read-write image: read-only/auto-read-only 
combinations ===

@@ -49,11 +49,11 @@
  node0: TEST_DIR/t.IMGFMT (file, read-only)
  node0: TEST_DIR/t.IMGFMT (file, read-only)

-QEMU_PROG: -blockdev 
driver=file,filename=TEST_DIR/t.IMGFMT,node-name=node0,read-only=off,auto-read-only=off: 
Could not open 'TEST_DIR/t.IMGFMT': Permission denied
-node0: TEST_DIR/t.IMGFMT (file, read-only)
-QEMU_PROG: -blockdev 
driver=file,filename=TEST_DIR/t.IMGFMT,node-name=node0,read-only=off: 
Could not open 'TEST_DIR/t.IMGFMT': Permission denied
+node0: TEST_DIR/t.IMGFMT (file)
+node0: TEST_DIR/t.IMGFMT (file)
+node0: TEST_DIR/t.IMGFMT (file)

-QEMU_PROG: -blockdev 
driver=file,filename=TEST_DIR/t.IMGFMT,node-name=node0,auto-read-only=off: 
Could not open 'TEST_DIR/t.IMGFMT': Permission denied
-node0: TEST_DIR/t.IMGFMT (file, read-only)
-QEMU_PROG: -blockdev 
driver=file,filename=TEST_DIR/t.IMGFMT,node-name=node0: Could not open 
'TEST_DIR/t.IMGFMT': Permission denied
+node0: TEST_DIR/t.IMGFMT (file)
+node0: TEST_DIR/t.IMGFMT (file)
+node0: TEST_DIR/t.IMGFMT (file)
  *** done
Failures: 232
Failed 1 of 1 tests


Thank you
Farhan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] qemu-iotests 232 fails when running the test as root user
  2018-11-29 21:03 [Qemu-devel] qemu-iotests 232 fails when running the test as root user Farhan Ali
@ 2018-11-29 21:07 ` Eric Blake
  2018-11-29 21:46   ` Farhan Ali
  2018-11-30 10:00   ` Daniel P. Berrangé
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Blake @ 2018-11-29 21:07 UTC (permalink / raw)
  To: Farhan Ali, qemu-block, QEMU Developers, Kevin Wolf

On 11/29/18 3:03 PM, Farhan Ali wrote:
> Hi,
> 
> I am seeing a failure of the qemu-iotest number 232 when running the 
> test as a root user. Is this the expected behavior?
> 
> Here is the output of the failure:
> 

> -QEMU_PROG: -drive 
> driver=file,file=TEST_DIR/t.IMGFMT,if=none,read-only=off,auto-read-only=off: 
> Could not open 'TEST_DIR/t.IMGFMT': Permission denied
> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> -
> -QEMU_PROG: -drive 
> driver=file,file=TEST_DIR/t.IMGFMT,if=none,auto-read-only=off: Could not 
> open 'TEST_DIR/t.IMGFMT': Permission denied
> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> +NODE_NAME: TEST_DIR/t.IMGFMT (file)

Not entirely unexpected (since root can read what are otherwise 
read-only files), but obviously unexpected by the test. The test should 
probably refuse to run as root.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] qemu-iotests 232 fails when running the test as root user
  2018-11-29 21:07 ` Eric Blake
@ 2018-11-29 21:46   ` Farhan Ali
  2018-11-30 10:00   ` Daniel P. Berrangé
  1 sibling, 0 replies; 4+ messages in thread
From: Farhan Ali @ 2018-11-29 21:46 UTC (permalink / raw)
  To: Eric Blake, qemu-block, QEMU Developers, Kevin Wolf



On 11/29/2018 04:07 PM, Eric Blake wrote:
> On 11/29/18 3:03 PM, Farhan Ali wrote:
>> Hi,
>>
>> I am seeing a failure of the qemu-iotest number 232 when running the 
>> test as a root user. Is this the expected behavior?
>>
>> Here is the output of the failure:
>>
> 
>> -QEMU_PROG: -drive 
>> driver=file,file=TEST_DIR/t.IMGFMT,if=none,read-only=off,auto-read-only=off: 
>> Could not open 'TEST_DIR/t.IMGFMT': Permission denied
>> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
>> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
>> -
>> -QEMU_PROG: -drive 
>> driver=file,file=TEST_DIR/t.IMGFMT,if=none,auto-read-only=off: Could 
>> not open 'TEST_DIR/t.IMGFMT': Permission denied
>> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
>> -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
>> +NODE_NAME: TEST_DIR/t.IMGFMT (file)
> 
> Not entirely unexpected (since root can read what are otherwise 
> read-only files), but obviously unexpected by the test. The test should 
> probably refuse to run as root.
> 

Yes, I believe it would be better if there was a check to prevent 
running this test as root.

Thanks
Farhan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] qemu-iotests 232 fails when running the test as root user
  2018-11-29 21:07 ` Eric Blake
  2018-11-29 21:46   ` Farhan Ali
@ 2018-11-30 10:00   ` Daniel P. Berrangé
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2018-11-30 10:00 UTC (permalink / raw)
  To: Eric Blake; +Cc: Farhan Ali, qemu-block, QEMU Developers, Kevin Wolf

On Thu, Nov 29, 2018 at 03:07:54PM -0600, Eric Blake wrote:
> On 11/29/18 3:03 PM, Farhan Ali wrote:
> > Hi,
> > 
> > I am seeing a failure of the qemu-iotest number 232 when running the
> > test as a root user. Is this the expected behavior?
> > 
> > Here is the output of the failure:
> > 
> 
> > -QEMU_PROG: -drive driver=file,file=TEST_DIR/t.IMGFMT,if=none,read-only=off,auto-read-only=off:
> > Could not open 'TEST_DIR/t.IMGFMT': Permission denied
> > -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> > -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> > -
> > -QEMU_PROG: -drive
> > driver=file,file=TEST_DIR/t.IMGFMT,if=none,auto-read-only=off: Could not
> > open 'TEST_DIR/t.IMGFMT': Permission denied
> > -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> > -NODE_NAME: TEST_DIR/t.IMGFMT (file, read-only)
> > +NODE_NAME: TEST_DIR/t.IMGFMT (file)
> 
> Not entirely unexpected (since root can read what are otherwise read-only
> files), but obviously unexpected by the test. The test should probably
> refuse to run as root.

I'd suggest that *all* our tests shoudl refuse to run as root as a matter
of principal. The risk of them doing damage is way too high and there is
no good reason why anyone should be building & testing QEMU as root
rather than an unprivileged user.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-30 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-29 21:03 [Qemu-devel] qemu-iotests 232 fails when running the test as root user Farhan Ali
2018-11-29 21:07 ` Eric Blake
2018-11-29 21:46   ` Farhan Ali
2018-11-30 10:00   ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).