This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2196182 - chardev tcp connection with tls disconnected after vm start
Summary: chardev tcp connection with tls disconnected after vm start
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Marc-Andre Lureau
QA Contact: liunana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-08 09:15 UTC by zhentang
Modified: 2023-09-22 17:51 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 17:51:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7531 0 None Migrated None 2023-09-22 17:51:48 UTC
Red Hat Issue Tracker RHELPLAN-156591 0 None None None 2023-05-08 09:17:36 UTC

Description zhentang 2023-05-08 09:15:06 UTC
Description of problem:
chardev tcp connection with tls disconnected after vm start

Version-Release number of selected component (if applicable):
libvirt-9.4.0-1.fc39.x86_64
qemu-kvm-8.0.0-3.fc39.x86_64

How reproducible:
100%

Steps to Reproduce:

scenario : start a guest with a chardev as a tcp client----------------------------
1.prepare tls env and start a server

# ll /etc/pki/libvirt-chardev/
total 36
-rw-r--r--. 1 root root 1448 May  4 06:31 ca-cert.pem
-rw-r--r--. 1 root root 8177 May  4 06:31 ca-key.pem
-rw-r--r--. 1 root root 1582 May  4 06:31 client-cert.pem
-rw-r--r--. 1 root root 8167 May  4 06:31 client-key.pem
-rw-r--r--. 1 root root 1582 May  4 06:31 server-cert.pem
-rw-r--r--. 1 root root 8177 May  4 06:31 server-key.pem

# gnutls-serv --echo --x509cafile /etc/pki/libvirt-chardev/ca-cert.pem --x509keyfile /etc/pki/libvirt-chardev/server-key.pem --x509certfile /etc/pki/libvirt-chardev/server-cert.pem
Processed 1 CA certificate(s).
Echo Server listening on IPv4 0.0.0.0 port 5556...done
Echo Server listening on IPv6 :: port 5556...done


2. modify qemu.conf
...
chardev_tls = 1
chardev_tls_x509_cert_dir = "/etc/pki/libvirt-chardev"
...

3. start a guest with a chardev as tcp client

# virsh dumpxml rhel9-bugverify --xpath //console
<console type="tcp">
  <source mode="connect" host="127.0.0.1" service="5556" tls="yes"/>
  <protocol type="raw"/>
  <target type="serial" port="0"/>
  <alias name="serial0"/>
</console>

# virsh start rhel9-bugverify 
Domain 'rhel9-bugverify' started


(on server side)
* Accepted connection from IPv4 127.0.0.1 port 34794 on Mon May  8 08:11:44 202
- Peer's certificate was NOT verified.
- Description: (TLS1.3-X.509)-(ECDHE-X25519)-(RSA-PSS-RSAE-SHA256)-(AES-256-GCM)
.......................


.......................

- Ephemeral EC Diffie-Hellman parameters
 - Using curve: X25519
 - Curve size: 256 bits
- Version: TLS1.3
- Server Signature: RSA-PSS-RSAE-SHA256
- Client Signature: RSA-PSS-RSAE-SHA256
- Cipher: AES-256-GCM
- MAC: AEAD
- Options: extended master secret, safe renegotiation,
- Channel bindings
 - 'tls-unique': not available
 - 'tls-server-end-point': 7fd09330c70a23c0cefa1a08153a2d775537662218391ce960dccf11cc6a8174
 - 'tls-exporter': 85b17844f9643d367f63effa480b916d0f95905e4d8ae9427749684245135ddf
Error while receiving data
Error: The TLS connection was non-properly terminated.








Actual results:
get error on server side and no boot info 

Error while receiving data
Error: The TLS connection was non-properly terminated.


Expected results:
client guest boot info displayed on server side.

Additional info:

Comment 1 Peter Krempa 2023-05-09 10:51:09 UTC
Moving to qemu. After startup of the VM the TLS communication is handled by qemu.

Comment 2 Marc-Andre Lureau 2023-05-10 07:30:13 UTC
Most likely, the certificate check is failing. 

Sadly, qemu doesn't report the error. I sent a patch for QEMU:
https://patchew.org/QEMU/20230510072531.3937189-1-marcandre.lureau@redhat.com/

@berrange, other idea?

Comment 3 John Ferlan 2023-06-22 11:16:08 UTC
Moving back to assigned in order to go through the proper RHEL downstream process in order to get the bug included downstream

Comment 5 Daniel Berrangé 2023-07-26 17:11:15 UTC
(In reply to Marc-Andre Lureau from comment #2)
> Most likely, the certificate check is failing. 
> 
> Sadly, qemu doesn't report the error. I sent a patch for QEMU:
> https://patchew.org/QEMU/20230510072531.3937189-1-marcandre.lureau@redhat.
> com/
> 
> @berrange, other idea?

These kind of things are almost always configuration mistakes, but diagnosing is a complete pain.

Using the qemu-trace-stap tool to watch 'qcrypto*' tracepoints is probably a good next step

Comment 6 RHEL Program Management 2023-09-22 17:51:33 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 7 RHEL Program Management 2023-09-22 17:51:53 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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