[Home]

Summary:ASTERISK-28854: SIGSEGV when pjsip show history encounters IPV6 address
Reporter:Roger James (wearyhacker)Labels:patch
Date Opened:2020-04-27 11:13:16Date Closed:2020-05-11 16:28:02
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:17.3.0 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-28415 segfault: sprint_list_entry (entry=entry@entry=0x7f9e30b4d8b0, line=line@entry=0x7f9e70676590 "\340ggp\236\177", len=256) at res_pjsip_history.c:669
Environment:LinuxAttachments:( 0) 0001-IPV6-address-fix.patch
Description:In  res_pjsip_history.c
{noformat}
/*! \brief An item in the history */
struct pjsip_history_entry {
...
/*! \brief Source address */
pj_sockaddr_in src; This is only long enough to hold an ipv4 address
/*! \brief Destination address */
pj_sockaddr_in dst; Same herw
      ...
};
{noformat}
Calls like these oveflow the fields when an IPV6 address is encountered.
{noformat}
/*! \brief PJSIP callback when a SIP message is transmitted */
static pj_status_t history_on_tx_msg(pjsip_tx_data *tdata)
{
       struct pjsip_history_entry *entry;
       ...
       pj_sockaddr_cp(&entry->src, &tdata->tp_info.transport->local_addr);
       pj_sockaddr_cp(&entry->dst, &tdata->tp_info.dst_addr);
{noformat}
Result SIGSEGV.

*EDIT*: Removed inline patch


Comments:By: Asterisk Team (asteriskteam) 2020-04-27 11:13:17.748-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Kevin Harwell (kharwell) 2020-04-27 15:41:33.614-0500

Unfortunately, we can't allow/accept inline patches in the description or comments. If you'd like to submit a patch please see the following:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines
https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process

By: Roger James (wearyhacker) 2020-04-27 15:45:02.454-0500

patch

By: Roger James (wearyhacker) 2020-04-27 15:54:26.843-0500

Looks like our messages crossed. I thought I would attach a patch whilst I waited for your legal department do whatever it does. It is the fisrst and hopefully the last time I ever had to agree to legal ******* to contribute to an open source project. The patch is so trivial it us hardly worth it.

By: Kevin Harwell (kharwell) 2020-04-27 16:02:12.704-0500

Ah yeah seems so.

If you have interest, and want to speed things along feel free to also go ahead and submit the patch via gerrit [1]

[1] https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage

By: Friendly Automation (friendly-automation) 2020-05-11 16:28:03.070-0500

Change 14403 merged by Friendly Automation:
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

[https://gerrit.asterisk.org/c/asterisk/+/14403|https://gerrit.asterisk.org/c/asterisk/+/14403]

By: Friendly Automation (friendly-automation) 2020-05-11 16:50:21.706-0500

Change 14397 merged by Kevin Harwell:
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

[https://gerrit.asterisk.org/c/asterisk/+/14397|https://gerrit.asterisk.org/c/asterisk/+/14397]

By: Friendly Automation (friendly-automation) 2020-05-11 16:50:36.676-0500

Change 14398 merged by Kevin Harwell:
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

[https://gerrit.asterisk.org/c/asterisk/+/14398|https://gerrit.asterisk.org/c/asterisk/+/14398]

By: Friendly Automation (friendly-automation) 2020-05-11 16:50:47.689-0500

Change 14399 merged by Kevin Harwell:
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

[https://gerrit.asterisk.org/c/asterisk/+/14399|https://gerrit.asterisk.org/c/asterisk/+/14399]