[asterisk-bugs] [JIRA] (ASTERISK-27170) pjproject: Unsafe usage of gethostbyname causing memory corruption

nappsoft (JIRA) noreply at issues.asterisk.org
Mon Oct 23 23:53:22 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=239571#comment-239571 ] 

nappsoft commented on ASTERISK-27170:
-------------------------------------

This is complete nonsense: of course musl supports getaddrinfo (also the version used by me: checking if getaddrinfo() is available... yes). You must have looked into pjproject and musl wrongly, as it is quite obvious that in the described case pj_gethostbyname is used (I've put into one message the complete sequence of involved functions, nothing is influenced by PJ_SOCK_HAS_GETADDRINFO there... So I really don't know what you're talking about).

I've fixed the issue for my needs more than two months ago (see submitted patch), everyhting is working perfect since then. It took some minutes to fix it after I've discovered the reasons for the memory corruptions, so I don't understand why the asterisk devs didn't integrate a fix before the pjsip team fixed it (after days without anything happening I've also reported the bug to the pjsip team, which fixed the issue immediatly (fixed in 2.7)). So as you bundle pjproject 2.7 now, the issue should be fixed. Have a look at the changes made by the pjsip team: https://trac.pjsip.org/repos/changeset/5644/pjproject

> pjproject: Unsafe usage of gethostbyname causing memory corruption
> ------------------------------------------------------------------
>
>                 Key: ASTERISK-27170
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27170
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: PBX/General
>    Affects Versions: 13.16.0, 13.17.0
>         Environment: 64bit linux musl 1.1.16-git
>            Reporter: nappsoft
>            Assignee: Unassigned
>         Attachments: backtrace4.txt, crashlog.txt, gethostbyname_r.diff, trace_cel_crash.txt, trace.txt, valgrind2.txt, valgrind4.txt, vgcore.24994-brief.txt, vgcore.24994-full.txt, vgcore.24994-locks.txt, vgcore.24994-thread1.txt
>
>
> From time to time asterisk crashes when a component is trying to allocate memory. According to the sip traces this seem to happen mainly soon (sometimes some milliseconds, sometimes a few seconds) after a call in which a PickupChan operation was involved has been finished.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list