Preventing stack guard-page hopping
Preventing stack guard-page hopping
Posted Jun 20, 2017 1:40 UTC (Tue) by zblaxell (subscriber, #26385)In reply to: Preventing stack guard-page hopping by Cyberax
Parent article: Preventing stack guard-page hopping
That's pretty much how C++11 async functions work, and should be covered by the heuristic exception for "thread A creates thread B".
It wouldn't work if there was a persistent worker thread pool (i.e. the functions are executed by previously existing threads that continue to exist after the result is computed, so there is no creator/created or join relationship). It might be possible to infer data dependencies from mutex locks or higher-level objects (promise/future pairs) but maybe there's too many false positives. Or one could mark worker pool threads differently (e.g. some new pthread_attr) wrt access to other threads' stacks.