backend: move freeing of td->mutex to main thread
authorJens Axboe <axboe@fb.com>
Mon, 3 Apr 2017 14:46:34 +0000 (08:46 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 3 Apr 2017 14:46:34 +0000 (08:46 -0600)
commit5ba01402d96e113ac451441f45d0c8b4dd281f4d
tree50a02e6811eebe323fd661e365536d2535ae0eb9
parent249ad5bfaded90c0431041b4a3816e7371c2d403
backend: move freeing of td->mutex to main thread

On some platforms, we can end up freeing td->mutex while the wakee
is still inside fio_mutex_up(). This introduces a use-after-free
condition, and we crash.

Free the main thread_data mutex from the main thread instead,
when we know the process/thread is long dead and gone.

Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c