summaryrefslogtreecommitdiff
path: root/autoconf/ast_func_fork.m4
diff options
context:
space:
mode:
authorIvan Poddubny <ivan.poddubny@gmail.com>2015-05-31 20:37:40 +0300
committerIvan Poddubny <ivan.poddubny@gmail.com>2015-06-10 09:38:37 -0500
commit8af6c9cf6bc9f8217fd96f59a6f248330583bdb9 (patch)
tree6314beb30f4e5afc4ba1bfdd8c61a99bb0970d7a /autoconf/ast_func_fork.m4
parent8ea1c0aa81e5bd17e5a46fbd6360829755f041b0 (diff)
res_pjsip_transport_websocket: Fix use-after-free bugs.
This patch fixes use-after-free bugs caught by AddressSanitizer. 1. PJSIP transport manager may decide to destroy transport on its own. For example, when the contact registered via websocket has not renewed its registration in time. The transport was destoyed, but the websocket listener thread was still active until the socket closes, and then tried to call transport_shutdown on transport that has been freed. Also, the transport destructor accessed wstransport->rdata.tp_info.pool right after freeing memory that contained wstransport itself. This patch converts transport to an ao2 object, allowing it to be refcounted, so that it is available until both websocket listener and pjsip transport manager are finished with it. 2. The websocket listener deletes the last reference on websocket session when the tcp connection is closed, and it gets destroyed, but the transport manager may still use it, for example when disconnect happens in the middle of a SIP transaction. A new reference to websocket session has been added that is released with the transport to prevent this. ASTERISK-25096 #close Reported by: Josh Kitchens ASTERISK-24963 #close Reported by: Badalian Vyacheslav Change-Id: Idc0b63eb6e459c1ddfb2430127d34b3c4d8d373b
Diffstat (limited to 'autoconf/ast_func_fork.m4')
0 files changed, 0 insertions, 0 deletions