Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1454362 - QEMU fails to report error when requesting migration bind to "::" when ipv6 disabled
QEMU fails to report error when requesting migration bind to "::" when ipv6 d...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Eric Blake
xianwang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-22 10:39 EDT by Daniel Berrange
Modified: 2018-04-10 20:21 EDT (History)
11 users (show)

See Also:
Fixed In Version: qemu-kvm-rhev-2.10.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 20:19:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1104 None None None 2018-04-10 20:21 EDT

  None (edit)
Description Daniel Berrange 2017-05-22 10:39:49 EDT
Description of problem:

Consider the following migration arg:

$ qemu-system-x86_64 -incoming tcp:[::]:9000,ipv4

which requests binding to a IPv6 address "::", but also requests IPv4 access only. This is a nonsensical combination and should report an error message. Indeed, other QEMU backends (VNC, chardev, etc) do report an error in this scenario, but the migration code does not, due to a bug in inet_parse


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.9.0-1.el7

How reproducible:
Always

Steps to Reproduce:
1. $ qemu-system-x86_64 -incoming tcp:[::]:9000,ipv4
2.
3.

Actual results:
QEMU listens on "::"

Expected results:
Exits with error message such as 

qemu-system-x86_64: -incoming tcp:[::]:9000,ipv4: address resolution failed for :::9000: Address family for hostname not supported
Comment 2 Daniel Berrange 2017-05-22 10:41:07 EDT
This is fixed by patch 2 in this small series

https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg04707.html
Comment 3 Eric Blake 2017-06-10 23:33:28 EDT
Dan's series is now at v3:
https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg00027.html

Depending on urgency and timing deadlines, we may want to port those patches downstream without waiting for an upstream pull request to land.
Comment 6 Eric Blake 2017-07-17 12:43:56 EDT
Will be picked up for 7.5 via rebase, because it is included in upstream 2.10:

commit 4dc5d815c43b0138e5d6753e788343f6e2cb6b5f
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Wed May 17 18:35:40 2017 +0100

    sockets: don't block IPv4 clients when listening on "::"
    
    When inet_parse() parses the hostname, it is forcing the
    has_ipv6 && ipv6 flags if the address contains a ":". This
    means that if the user had set the ipv4=on flag, to try to
    restrict the listener to just ipv4, an error would not have
    been raised.  eg
    
       -incoming tcp:[::]:9000,ipv4
    
    should have raised an error because listening for IPv4
    on "::" is a non-sensical combination. With this removed,
    we now call getaddrinfo() on "::" passing PF_INET and
    so getaddrinfo reports an error about the hostname being
    incompatible with the requested protocol:
    
     qemu-system-x86_64: -incoming tcp:[::]:9000,ipv4: address resolution
        failed for :::9000: Address family for hostname not supported
    
    Likewise it is explicitly setting the has_ipv4 & ipv4
    flags when the address contains only digits + '.'. This
    has no ill-effect, but also has no benefit, so is removed.
    
    Acked-by: Gerd Hoffmann <kraxel@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Comment 12 Qunfang Zhang 2017-11-27 02:44:32 EST
Reproduced on qemu-kvm-rhev-2.9.0-16.el7_4.12.ppc64le:

]# /usr/libexec/qemu-kvm -incoming tcp:[::]:9000,ipv4
VNC server running on ::1:5900

Verified on qemu-kvm-rhev-2.10.0-7.el7.ppc64le:

# /usr/libexec/qemu-kvm -incoming tcp:[::]:9000,ipv4
VNC server running on ::1:5900
qemu-kvm: -incoming tcp:[::]:9000,ipv4: address resolution failed for :::9000: Address family for hostname not supported

QEMU failed to boot up when incoming migration process bind with ipv6 address while ipv6 is disabled. 

Setting to VERIFIED.
Comment 14 errata-xmlrpc 2018-04-10 20:19:31 EDT
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.

https://access.redhat.com/errata/RHSA-2018:1104

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