]> git.ipfire.org Git - thirdparty/samba.git/commit
tevent: Fix a race condition
authorVolker Lendecke <vl@samba.org>
Fri, 10 Nov 2017 20:22:26 +0000 (21:22 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Nov 2017 11:39:13 +0000 (12:39 +0100)
commit5cb686dd30d511dc2add9d38983ebe3ce42ba890
treea5532379407cdfd9805d41ca1aa25269e319954d
parent148ab679e473adee407c187a3dd50eebec2c4486
tevent: Fix a race condition

We can't rely on tctx to exist after we unlocked the mutex. It took a
while, but this does lead to data corruption. If *tctx is replaced with
something where tctx->wakeup_fd points to a real, existing file
descriptor, we're screwed. And by screwed, this means file corruption
on disk.

Again. I am not tall enough for this business.

http://bholley.net/blog/2015/must-be-this-tall-to-write-multi-threaded-code.html

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13130

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 11 03:20:09 CET 2017 on sn-devel-144

(cherry picked from commit 20cfcb7dbc5dd099384b76a76e3d35cf627100b6)

Autobuild-User(v4-7-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-7-test): Mon Nov 13 13:54:56 CET 2017 on sn-devel-144

(cherry picked from commit 5ec68b2e44e5c0c4e6fae362c7e36ad99124faa8)
lib/tevent/tevent_threads.c