2

Fix crash and deadlocks in the support for recursive logging by Smjert · Pull Re...

 2 years ago
source link: https://github.com/osquery/osquery/pull/7127
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Member

Smjert commented on May 28, 2021

The code has been slightly refactored to remove an incorrect usage
of std::futures in a queue, where it was possible to try to wait on the
same std::future twice, which would lead to a crash.

Even after fixing the crash, it was possible that threads dealing
with recursive logging would change order and wait on a std::future
of another thread, causing a deadlock.

Finally the deferred log relaying wasn't always used when it should've,
due to a confusion between boolean values.
A enum class has been used instead to be more expressive about
the relaying mode asked.

Fixes #6928


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK