RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1365708 - qemu-kvm gets SIGSEGV when attach a json backing image of ssh protocol
Summary: qemu-kvm gets SIGSEGV when attach a json backing image of ssh protocol
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Hanna Czenczek
QA Contact: Ping Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-10 01:54 UTC by Han Han
Modified: 2018-03-22 03:30 UTC (History)
16 users (show)

Fixed In Version: 2.7.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 23:32:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:2392 0 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2017-08-01 20:04:36 UTC

Comment 3 Hanna Czenczek 2016-08-12 13:29:28 UTC
Hi Han,

The immediate issue here is that qemu's ssh driver expects the "port" argument to be an integer and not a string. So it should work if you replace "file.port":"22" by "file.port":22.

The segfault itself is rather "safe" in that it will always only dereference NULL, so it can be used for DoS at most. However, it still is an issue that needs fixing, of course.

The problem is that the type of options passed via -drive or JSON are not validated like options passed via blockdev-add are. However, many block drivers assume they are, including SSH. The issue can be reproduced even simpler like so:
$ qemu-system-x86_64 -drive if=none,driver=ssh,host=foo,port=22
[1]    7996 segmentation fault (core dumped)  qemu-system-x86_64 -drive if=none,driver=ssh,host=foo,port=22

This is because each value is treated as a string but ssh expects the port to be set to an integer.

But the issue exists for other block drivers as well, e.g. NBD expects all of its arguments to be strings, so we can do this:
$ qemu-img info "json:{'driver':'nbd', 'host':42}"     
[1]    7103 segmentation fault (core dumped)  ./qemu-img info "json:{'driver':'nbd', 'host':42}"

Or it will ignore a port specified as an integer:
$ qemu-img info "json:{'driver':'nbd', 'host':'foo', 'port':42}"
qemu-img: Could not open 'json:{'driver':'nbd', 'host':'foo', 'port':42}': address resolution failed for foo:10809: Name or service not known

Which is better than crashing, admittedly, but not really good still.


So because I do not consider this issue absolutely critical (it will always result in a NULL pointer getting dereferenced which is certain to result in a plain crash), because the fix will not be trivial, and because we're rather late in the release process, I'd rather move this BZ to 7.4.

Max

Comment 7 Ping Li 2017-01-17 12:24:47 UTC
According to the comment 5, set the bug as verified.

Comment 9 errata-xmlrpc 2017-08-01 23:32:13 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.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 10 errata-xmlrpc 2017-08-02 01:09:52 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.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 11 errata-xmlrpc 2017-08-02 02:01:51 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.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 12 errata-xmlrpc 2017-08-02 02:42: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.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 13 errata-xmlrpc 2017-08-02 03:07:20 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.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 14 errata-xmlrpc 2017-08-02 03:27:29 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.

https://access.redhat.com/errata/RHSA-2017:2392


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