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 1911224 - virt-viewer core dumped when inputting an invalid password for a vnc vm in kiosk mode
Summary: virt-viewer core dumped when inputting an invalid password for a vnc vm in ki...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-viewer
Version: 8.4
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Default Assignee for SPICE Bugs
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1948357
TreeView+ depends on / blocked
 
Reported: 2020-12-28 08:53 UTC by zhoujunqin
Modified: 2021-11-09 20:50 UTC (History)
8 users (show)

Fixed In Version: virt-viewer-9.0-10.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 17:48:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-viewer debug log (14.22 KB, text/plain)
2020-12-28 08:53 UTC, zhoujunqin
no flags Details
screenshot for result-c (29.03 KB, image/png)
2021-03-15 09:10 UTC, zhoujunqin
no flags Details
screenshot for result-d (10.44 KB, image/png)
2021-03-15 09:10 UTC, zhoujunqin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4165 0 None None None 2021-11-09 17:48:24 UTC

Description zhoujunqin 2020-12-28 08:53:19 UTC
Created attachment 1742543 [details]
virt-viewer debug log

Description of problem:
virt-viewer core dumped when inputting an invalid password for a vnc vm in kiosk mode

Version-Release number of selected component (if applicable):
virt-viewer-9.0-5.el8.x86_64
virt-viewer-debuginfo-9.0-5.el8.x86_64
gtk-vnc2-0.9.0-2.el8.x86_64
libgovirt-0.3.7-4.el8.x86_64
kernel-4.18.0-266.el8.x86_64
libvirt-6.0.0-32.module+el8.4.0+9172+b707c649.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Prepare a vnc guest with authentication required.

# virsh dumpxml rhel7.9-vnc --security-info --inactive |grep -A7 graphics
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd='aabb'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>


2. Open the vm by "virt-viewer $guest -k", and then input an invalid password after the authentication dialog pops up.

$ virt-viewer -c qemu:///system  rhel7.9-vnc  -k

Test result:
After inputting an invalid password(such as 'test'), An authentication failed dialog pops up:
Unable to connect to the graphic server localhost:5900
Authentication failed

Click 'OK', then virt-viewer crashes.
...
Segmentation fault (core dumped)

Actual results:
As described.

Expected results:
Fix it.

Additional info:

Comment 1 Jakub Janků 2021-02-19 09:57:10 UTC
Should be fixed by:
https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/61

Comment 2 zhoujunqin 2021-03-15 09:09:29 UTC
I can reproduce this bug with the package:
virt-viewer-9.0-9.el8.x86_64

Then try to verify with a new build:
virt-viewer-9.0-10.el8.x86_64

Steps:
1. Prepare a vnc guest with authentication required.

# virsh dumpxml rhel8-vnc --security-info --inactive 
...
    <graphics type='vnc' port='-1' autoport='yes' passwd='aabb'>
      <listen type='address'/>
    </graphics>


2. Open the vm by "virt-viewer $guest -k", and then input an invalid password after the authentication dialog pops up.

$ virt-viewer -c qemu:///system  rhel7.9-vnc  -k

Test result:
a. After inputting an invalid password(such as 'test'), An authentication failed dialog pops up:

------------------------------------------------------
Unable to connect to the graphic server localhost:5902
Authentication failed
------------------------------------------------------

Click 'OK', then virt-viewer navigates to the previous authentication page.

b. Repeat inputting invalid password for 10 times, virt-viewer works well, no crash.

c. Click 'Cancel' directly on the authentication dialog, virt-viewer will show the authentication dialog again.
virt-viewer can't exit when in kiosk mode.
Even I use 'kill -9' to stop this process, command '$ virt-viewer  -c qemu:///system rhel8-vnc -k' keeps on the terminal
Is it the expected result, if not, I suggest filing a separate bug to track this issue, thanks

d. If I input an empty password on the authentication dialog, then click "OK".
virt-viewer will show an error message as follows:

------------------------------------------------------
Unable to connect to the graphic server 127.0.0.1:5902
Unknown authentication failure: %s: Weak encryption key
------------------------------------------------------

Click 'OK', then virt-viewer will display a white screen, details please see the attachment.

What's more, without in kiosk mode, if I input an empty password, then virt-viewer prompts the above error message, 
but after click 'OK', virt-viewer will exit silently.

@Jakub, please help double-check the results c and d, thanks.

Comment 3 zhoujunqin 2021-03-15 09:10:21 UTC
Created attachment 1763334 [details]
screenshot for result-c

Comment 4 zhoujunqin 2021-03-15 09:10:55 UTC
Created attachment 1763335 [details]
screenshot for result-d

Comment 5 Jakub Janků 2021-03-15 16:43:54 UTC
The new build should be mostly consistent with the builds prior to virt-viewer-9.0-5. What's new is the error dialog in case d).
I checked with 9.0-2 on fedora 33 and both of the issues, c) and d), are present.

Regarding c), I'm not sure whether that's by design or not. There should probably be some discussion. I can imagine that both not allowing and allowing to exit while not connected in kiosk mode could make sense in some scenarios.

As for d), it should be fixed. The error message also shouldn't contain the "%s", but that's a bug in gtk-vnc, if I'm not mistaken.

So I'd open a new bug at least for d), possibly for c).

Comment 15 zhoujunqin 2021-04-15 04:04:52 UTC
Verify this bug with builds:
virt-viewer-9.0-10.el8.x86_64
qemu-kvm-4.2.0-48.module+el8.4.0+10368+630e803b.x86_64
libvirt-6.0.0-35.module+el8.4.0+10230+7a9b21e4.x86_64

Steps:
Steps:
1. Prepare a vnc guest with authentication required.

# virsh dumpxml vnc --security-info --inactive 
...
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' sharePolicy='ignore' passwd='aabb'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>


2. Open the vm by "virt-viewer $guest -k", and then input an invalid password after the authentication dialog pops up.

$ virt-viewer -c qemu:///system vnc -k

Test result:
a. After inputting an invalid password(such as 'test'), An authentication failed dialog pops up:

------------------------------------------------------
Unable to connect to the graphic server localhost:5902
Authentication failed
------------------------------------------------------

Click 'OK', then virt-viewer navigates to the previous authentication page.

b. Repeat inputting invalid password for 10 times, virt-viewer works well, no crash.

So the bug issue is fixed, I move the bug from ON_QA to VERIFIED status, thanks.

Comment 19 errata-xmlrpc 2021-11-09 17:48:12 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 (virt-viewer bug fix and enhancement update), 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/RHBA-2021:4165


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