[Asterisk-code-review] res rtp asterisk: Prevent simultaneous access to DTLS SSL co... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Tue Jul 7 11:29:59 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: res_rtp_asterisk: Prevent simultaneous access to DTLS SSL context.
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/787/3/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:

Line 1779: 	ast_mutex_lock(&dtls->lock);
         : 	if (dtls->timeout_timer == -1) {
         : 		ast_mutex_unlock(&dtls->lock);
         : 		return;
         : 	}
This can cause a deadlock in v13+ because of a change in how AST_SCHED_DEL() operates.  If the scheduled event is executing at the same time as you trying to stop the scheduled event then this can cause a deadlock.  AST_SCHED_DEL() now waits for the currently executing event it is trying to delete to complete before returning.


Line 1838: 	ast_mutex_lock(&dtls->lock);
         : 	if (!AST_SCHED_DEL(rtp->sched, dtls->timeout_timer)) {
         : 		ao2_ref(instance, -1);
         : 	}
         : 	ast_mutex_unlock(&dtls->lock);
         : }
Deadlock potential.  See explanation at the timeout function.


-- 
To view, visit https://gerrit.asterisk.org/787
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib75ea2546f29d6efc3d2d37c58df6986c7bd9b91
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list