[Asterisk-code-review] core_unreal: Fix deadlock with T.38 control frames. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Fri Mar 19 08:55:55 CDT 2021


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15637 )


Change subject: core_unreal: Fix deadlock with T.38 control frames.
......................................................................

core_unreal: Fix deadlock with T.38 control frames.

When using the ast_unreal_lock_all function no channel
locks can be held before calling it.

This change unlocks the channel that indicate was
called on before doing so and then relocks it afterwards.

ASTERISK-29035

Change-Id: Id65016201b5f9c9519a216e250f9101c629e19e9
---
M main/core_unreal.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/37/15637/1

diff --git a/main/core_unreal.c b/main/core_unreal.c
index 5adc90d..b03e945 100644
--- a/main/core_unreal.c
+++ b/main/core_unreal.c
@@ -682,6 +682,9 @@
 		break;
 	case AST_CONTROL_T38_PARAMETERS:
 		parameters = data;
+
+		ast_channel_unlock(ast);
+
 		if (parameters->request_response == AST_T38_NEGOTIATED) {
 			struct ast_stream *stream;
 			struct ast_stream_topology *new_topology;
@@ -762,6 +765,9 @@
 			ast_channel_unlock(chan);
 			ast_channel_unref(chan);
 		}
+
+		ast_channel_lock(ast);
+
 		/* Fall through for all T38 conditions */
 	default:
 		res = unreal_queue_indicate(p, ast, condition, data, datalen);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15637
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Id65016201b5f9c9519a216e250f9101c629e19e9
Gerrit-Change-Number: 15637
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210319/4fc2768c/attachment.html>


More information about the asterisk-code-review mailing list