Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bfc8d99b authored by Ben Schwartz's avatar Ben Schwartz
Browse files

Copy queries synchronously in DnsTlsSocket

Prior to this change, each outgoing query was copied only once,
on the DnsTlsSocket's loop thread.  This could create a problem
if a misbehaving server sent an erroneous response with a
colliding ID number after the query was given to DnsTlsSocket
but before the copy was made.  The erroneous response would
complete the query, causing the caller to deallocate the backing
buffer, resulting in a segfault on copy.

This change moves the copy earlier, onto the calling thread, thus
ensuring that the backing buffer cannot have been deallocated.
Instead of sending the network thread pointers to query buffers,
copies of queries are stored in a shared queue, and the network
thread is notified of new queries on an eventfd socket.

Bug: 122133500
Test: Integrations tests pass, manual tests good.  No regression test.
Change-Id: Ia4e72da561aeef69a17e87bfdc7aa04340c12fd0
parent 110c54e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment