[Asterisk-code-review] core_unreal: Fix deadlock with T.38 control frames. (asterisk[18.3])
Joshua Colp
asteriskteam at digium.com
Fri Mar 19 10:02:29 CDT 2021
Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15652 )
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, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/15652/1
diff --git a/main/core_unreal.c b/main/core_unreal.c
index 5adc90d..a79fca4 100644
--- a/main/core_unreal.c
+++ b/main/core_unreal.c
@@ -710,6 +710,7 @@
* signaling and we need to be sure that the locking order is the same to prevent possible
* deadlocks.
*/
+ ast_channel_unlock(ast);
ast_unreal_lock_all(p, &chan, &owner);
if (owner) {
@@ -726,12 +727,14 @@
}
ao2_unlock(p);
+ ast_channel_lock(ast);
} else if (parameters->request_response == AST_T38_TERMINATED) {
/*
* Lock both parts of the local channel so we can restore their topologies to the original.
* The topology should be on the unreal_pvt structure, with a ref that we can steal. Same
* conditions as above.
*/
+ ast_channel_unlock(ast);
ast_unreal_lock_all(p, &chan, &owner);
if (owner) {
@@ -745,6 +748,7 @@
}
ao2_unlock(p);
+ ast_channel_lock(ast);
}
/*
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15652
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18.3
Gerrit-Change-Id: Id65016201b5f9c9519a216e250f9101c629e19e9
Gerrit-Change-Number: 15652
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/bd527d85/attachment.html>
More information about the asterisk-code-review
mailing list