Bug 1119207 - [rng]qemu-kvm process still can start when specify negative value for max-bytes
Summary: [rng]qemu-kvm process still can start when specify negative value for max-bytes
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: John Snow
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-14 09:24 UTC by Mike Cao
Modified: 2015-11-23 03:37 UTC (History)
10 users (show)

Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-10-14 07:02:37 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1490 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2014-10-14 01:28:27 UTC

Description Mike Cao 2014-07-14 09:24:58 UTC
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Start VM with -max-byte=-1
CLI:# /usr/libexec/qemu-kvm -name 086RNGBLUE64NQB -enable-kvm -m 6G -smp 4 -uuid d58093ff-d9da-4f75-a648-922e78eac32f -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/086RNGBLUE64NQB,server,nowait -mon chardev=charmonitor,id=monitor1,mode=control -rtc base=localtime,driftfix=slew -boot order=cd,menu=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=086RNGBLUE64NQB,if=none,id=drive-ide0-0-0,format=raw,serial=mike_cao,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=en_windows_8_1_enterprise_x64_dvd_2971902.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=086RNGBLUE64NQB.vfd,if=none,id=drive-fdc0-0-0,format=raw,cache=none -global isa-fdc.driveA=drive-fdc0-0-0 -netdev tap,script=/etc/qemu-ifup,downscript=no,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=00:52:42:0f:05:69,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0 -device usb-tablet,id=input0 -vnc -vga cirrus -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,id=device-rng0,max-bytes=-100,period=1 -monitor stdio
2.(qemu)info qtree  (so such commands on qmp)

Actual results:
      dev: virtio-rng-pci, id "device-rng0"
        dev-prop: indirect_desc = on
        dev-prop: event_idx = on
        dev-prop: rng = "rng0"
        dev-prop: max-bytes = 18446744073709551516

Expected results:
   qemu-kvm process shouldn't boot up 

Additional info:
specify negative number for period eg period=-1 ,qemu-kvm can not start

Comment 2 Ademar Reis 2014-07-14 21:53:25 UTC
and upstream apparently crashes with assert(vrng->conf.max_bytes <= (9223372036854775807L))

Feel free to fix it upstream and close this as WONTFIX for RHEL6.

Comment 3 John Snow 2014-07-15 16:13:17 UTC
Submitted upstream, but awaiting merge. http://lists.gnu.org/archive/html/qemu-devel/2014-07/msg02348.html

Comment 4 John Snow 2014-07-23 20:29:01 UTC
Accepted upstream http://git.qemu.org/?p=qemu.git;a=commit;h=713e8a102222b6b8ca65050d13b287f5705831b0

backported and posted to rhvirt-patches.

Comment 5 John Snow 2014-07-29 17:35:20 UTC
Fixing another issue upstream first before resubmitting.

Comment 8 Jeff Nelson 2014-08-07 19:49:42 UTC
Fix included in qemu-kvm-

Comment 10 Shaolong Hu 2014-08-14 06:31:09 UTC
Reproduced on qemu-kvm-

boot guest with:
-device virtio-rng-pci,rng=rng0,id=device-rng0,max-bytes=-100,period=1

(qemu) info qtree
bus: main-system-bus
  type System
  dev: i440FX-pcihost, id ""
    bus: pci.0
      type PCI
      dev: virtio-rng-pci, id "device-rng0"
        dev-prop: indirect_desc = on
        dev-prop: event_idx = on
        dev-prop: rng = "rng0"
        dev-prop: max-bytes = 18446744073709551516
        dev-prop: period = 1
        bus-prop: addr = 06.0
        bus-prop: romfile = <null>
        bus-prop: rombar = 1
        bus-prop: multifunction = off
        class Class 00ff, addr 00:06.0, pci id 1af4:1005 (sub 1af4:0004)
        bar 0: i/o at 0xc100 [0xc11f]

Verified on qemu-kvm-

boot guest with:
-device virtio-rng-pci,rng=rng0,id=device-rng0,max-bytes=-100,period=1

qemu-kvm prompts error and exits:

qemu-kvm: -device virtio-rng-pci,rng=rng0,id=device-rng0,max-bytes=-100,period=1: Parameter 'max-bytes' expects a non-negative integer below 2^63
qemu-kvm: -device virtio-rng-pci,rng=rng0,id=device-rng0,max-bytes=-100,period=1: Device 'virtio-rng-pci' could not be initialized

Comment 11 errata-xmlrpc 2014-10-14 07:02:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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