s3: Fix a deadlock between notify_onelevel.tdb and notify.tdb
authorVolker Lendecke <vl@samba.org>
Wed, 22 Sep 2010 12:23:43 +0000 (05:23 -0700)
committerMichael Adam <obnox@samba.org>
Thu, 30 Sep 2010 10:30:45 +0000 (12:30 +0200)
notify_add() locks notify_onlevel.tdb while having notify.tdb locked.
file_free() calls notify_remove_onelevel(), and due to this talloc hierarchy
problem the tdb record is not unlocked again timely. Thus notify.tdb will be
locked while notify_onelevel still has a lock.

Sorry, Ronnie, for causing you some grey hair and thanks for the stacktraces.

Volker

source3/smbd/notify_internal.c

index 243335c9fc61eaa8b17b174c7dcc58715c6a474a..c8f8616d8b469a85a301bd2f25074c8631a82af7 100644 (file)
@@ -599,7 +599,7 @@ NTSTATUS notify_remove_onelevel(struct notify_context *notify,
        }
 
        rec = notify->db_onelevel->fetch_locked(
-               notify->db_onelevel, talloc_tos(),
+               notify->db_onelevel, array,
                make_tdb_data((uint8_t *)fid, sizeof(*fid)));
        if (rec == NULL) {
                DEBUG(10, ("notify_remove_onelevel: fetch_locked for %s failed"