From 1d53557df59adc691d726aa2094e877409a7f92c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Sep 2014 08:05:31 +0200 Subject: s3:smb2_lock: always use tevent_req_defer_callback() if we go async process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock() multiple times, which results in multiple tevent_req_done() calls. As we could disconnect the connection from there, process_blocking_lock_queue_smb2() could crash as the local state might be destroyed. Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/smbd/smb2_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c index 0713892473..29abbb2367 100644 --- a/source3/smbd/smb2_lock.c +++ b/source3/smbd/smb2_lock.c @@ -348,6 +348,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx, } if (async) { + tevent_req_defer_callback(req, smb2req->sconn->ev_ctx); return req; } @@ -388,7 +389,6 @@ static bool smbd_smb2_lock_cancel(struct tevent_req *req) smb2req = state->smb2req; remove_pending_lock(state, state->blr); - tevent_req_defer_callback(req, smb2req->sconn->ev_ctx); /* * If the request is canceled because of logoff, tdis or close -- cgit