[New-bugs-announce] [issue33674] asyncio: race condition in SSLProtocol

STINNER Victor report at bugs.python.org
Mon May 28 16:37:18 EDT 2018


New submission from STINNER Victor <vstinner at redhat.com>:

While debugging bpo-32458 (functional test on START TLS), I found a race condition in SSLProtocol of asyncio/sslproto.py.

Sometimes, _sslpipe.feed_ssldata() is called before _sslpipe.shutdown().

* SSLProtocol.connection_made() -> SSLProtocol._start_handshake(): self._loop.call_soon(self._process_write_backlog)
* SSLProtoco.data_received(): direct call to self._sslpipe.feed_ssldata(data)
* Later, self._process_write_backlog() calls self._sslpipe.do_handshake()

The first write is delayed by call_soon(), whereas the first read is a direct call to the SSL pipe.

----------
components: asyncio
messages: 317916
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: race condition in SSLProtocol
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33674>
_______________________________________


More information about the New-bugs-announce mailing list