]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix a crash by avoiding destroying TLS stream socket too early
authorArtem Boldariev <artem@boldariev.com>
Tue, 22 Mar 2022 18:24:46 +0000 (20:24 +0200)
committerMichal Nowak <mnowak@isc.org>
Wed, 4 May 2022 17:56:57 +0000 (19:56 +0200)
commitbd41100295ac4ddd194885acc5889152e1ccbc78
treebbf5a9512ba7dcc419ece30a67ded7b8da259772
parent2d44b863cc7a9d0d0aaa002e3b4c8fdcaf6996f8
Fix a crash by avoiding destroying TLS stream socket too early

This commit fixes a crash in generic TLS stream code, which could be
reproduced during some runs of the 'sslyze' tool.

The intention of this commit is twofold.

Firstly, it ensures that the TLS socket object cannot be destroyed too
early. Now it is being deleted alongside the underlying TCP socket
object.

Secondly, it ensures that the TLS socket object cannot be destroyed as
a result of calling 'tls_do_bio()' (the primary function which
performs encryption/decryption during the IO) as the code did not
expect that. This code path is fixed now.

(cherry picked from commit a696be6a2db0a6dedb87ba37959112ad394989b7)
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/tlsstream.c