BUG/MAJOR: ssl: fix segfault on connection close using async engines.
authorEmeric Brun <ebrun@haproxy.com>
Wed, 31 May 2017 10:02:53 +0000 (10:02 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Jun 2017 04:47:34 +0000 (06:47 +0200)
commitce9e01c6744262ec2bf88aa71f72bd8042dcad89
treeb1c801527bc69660d7ddfeecad0069604bec5d05
parentbd695fe024e8028fc96a5222c26dadf84f05402d
BUG/MAJOR: ssl: fix segfault on connection close using async engines.

This patch ensure that the ASYNC fd handlers won't be wake up
too early, disabling the event cache for this fd on connection close
and when a WANT_ASYNC is rised by Openssl.

The calls to SSL_read/SSL_write/SSL_do_handshake before rising a real read
event from the ASYNC fd, generated an EAGAIN followed by a context switch
for some engines, or a blocked read for the others.

On connection close it resulted in a too early call to SSL_free followed
by a segmentation fault.
src/ssl_sock.c