]> git.ipfire.org Git - thirdparty/qemu.git/commit
char: fix missing return in error path for chardev TLS init
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 30 Sep 2016 15:02:01 +0000 (16:02 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 2 Nov 2016 22:16:58 +0000 (17:16 -0500)
commit5be5335661a9c28f64e2b4e296063a7387ab498f
tree1a18cf66e5cedc1d26593eb19eced68aace15cfa
parentaf29bd3193015865f6b2ca6f5c9e79aad1df3e28
char: fix missing return in error path for chardev TLS init

If the qio_channel_tls_new_(server|client) methods fail,
we disconnect the client. Unfortunately a missing return
means we then go on to try and run the TLS handshake on
a NULL I/O channel. This gives predictably segfaulty
results.

The main way to trigger this is to request a bogus TLS
priority string for the TLS credentials. e.g.

  -object tls-creds-x509,id=tls0,priority=wibble,...

Most other ways appear impossible to trigger except
perhaps if OOM conditions cause gnutls initialization
to fail.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 660a2d83e026496db6b3eaec2256a2cdd6c74de8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-char.c