libosmo-sccp/src
Harald Welte c288852320 Revert "osmo_ss7: free the sock_name string once an ASP socket is closed"
This reverts commit 03e3b04234.

It caused a regression, as apparently some code is using the sock_name
string even after the close:

DLSS7 osmo_ss7.c:1676 0: asp-asp-dyn-0: xua_srv_conn_cb(): sctp_recvmsg() returned 12 (flags=0x8080)
DLSS7 osmo_ss7.c:1608 0: asp-asp-dyn-0: xUA SRV SCTP NOTIFICATION 32773 flags=0x0
DLSS7 osmo_ss7.c:1621 0: asp-asp-dyn-0: xUA SRV SHUTDOWN_EVENT
DLSS7 osmo_ss7.c:1875 asp-dyn-0: connection closed
DLSS7 osmo_ss7.c:1881 XUA_ASP(asp-dyn-0){ASP_INACTIVE}: Received Event SCTP-COMM_DOWN.ind
DLSS7 xua_asp_fsm.c:669 XUA_ASP(asp-dyn-0){ASP_INACTIVE}: state_chg to ASP_DOWN
DLSS7 xua_asp_fsm.c:113 0: asp-asp-dyn-0: No Layer Manager, dropping M-ASP_DOWN.indication
DLSS7 xua_asp_fsm.c:113 0: asp-asp-dyn-0: No Layer Manager, dropping M-SCTP_RELEASE.indication
DLSS7 osmo_ss7.c:1442 0: asp-asp-dyn-0: Destroying ASP
DLSS7 osmo_ss7.c:1449 XUA_ASP(asp-dyn-0){ASP_DOWN}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
DLSS7 osmo_ss7.c:1449 XUA_ASP(asp-dyn-0){ASP_DOWN}: Freeing instance
DLSS7 fsm.c:573 XUA_ASP(asp-dyn-0){ASP_DOWN}: Deallocated
=================================================================
==2928584==ERROR: AddressSanitizer: heap-use-after-free on address 0x618000004d28 at pc 0x7fd6cddeaff8 bp 0x7ffe978fbad0 sp 0x7ffe978fbac8
READ of size 8 at 0x618000004d28 thread T0
    #0 0x7fd6cddeaff7 in xua_srv_conn_closed_cb (/space/home/laforge/projects/git/libosmo-sccp/src/.libs/libosmo-sigtran.so.5+0x17bff7)
    #1 0x7fd6cc443d0f in osmo_stream_srv_destroy (/usr/local/lib/libosmonetif.so.8+0x7ed0f)
    #2 0x7fd6cdde8ce8 in xua_srv_conn_cb (/space/home/laforge/projects/git/libosmo-sccp/src/.libs/libosmo-sigtran.so.5+0x179ce8)
    #3 0x7fd6cc44285e in osmo_stream_srv_read (/usr/local/lib/libosmonetif.so.8+0x7d85e)
    #4 0x7fd6cc44331d in osmo_stream_srv_cb (/usr/local/lib/libosmonetif.so.8+0x7e31d)
    #5 0x7fd6cd88a1c7 in poll_disp_fds (/usr/local/lib/libosmocore.so.17+0x10d1c7)
    #6 0x7fd6cd88a30d in _osmo_select_main (/usr/local/lib/libosmocore.so.17+0x10d30d)
    #7 0x7fd6cd88a32c in osmo_select_main (/usr/local/lib/libosmocore.so.17+0x10d32c)
    #8 0x557aab05c078 in main /space/home/laforge/projects/git/libosmo-sccp/stp/stp_main.c:267
    #9 0x7fd6ccc50d09 in __libc_start_main ../csu/libc-start.c:308
    #10 0x557aab05b389 in _start (/space/home/laforge/projects/git/libosmo-sccp/stp/.libs/osmo-stp+0x3389)

Change-Id: I72f83114408e7a54d1f3072338fa6f189bf4064f
2021-04-30 15:51:22 +02:00
..
Makefile.am Bump version: 1.3.0.51-6858-dirty → 1.4.0 2021-02-23 17:57:33 +01:00
ipa.c ipa: Use VTY-configured default network indicator 2021-04-25 14:29:30 +02:00
m3ua.c xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00
mtp_pcap.c build: move include/{mtp,sccp} to include/osmocom/ 2018-10-21 12:35:11 +00:00
osmo_ss7.c Revert "osmo_ss7: free the sock_name string once an ASP socket is closed" 2021-04-30 15:51:22 +02:00
osmo_ss7_hmrt.c cosmetic: hmrt_message_for_routing(): use osmo_ss7_route_name() 2017-12-24 21:21:55 +01:00
osmo_ss7_vty.c vty: add attributes to VTY commands indicating when they apply 2020-10-06 22:50:10 +02:00
sccp.c big endian: add missing endian.h in sccp.c 2020-05-19 22:37:41 +02:00
sccp2sua.c sccp2sua: fix typo: s/omso_sccp_addr/osmo_sccp_addr/ 2020-06-02 02:02:20 +07:00
sccp_helpers.c add osmo_sccp_addr_to_id_c() 2020-09-23 21:13:18 +02:00
sccp_internal.h xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00
sccp_lbcs.c sccp: Notify users of point code available/unavailable 2021-02-08 18:00:56 +01:00
sccp_sap.c sccp_sap: Fix string for N-PCSTATE primitive 2021-02-07 18:28:48 +00:00
sccp_sclc.c add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() 2019-04-12 06:27:10 +02:00
sccp_scmg.c xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00
sccp_scoc.c SCOC: log message type that was received for unknown local reference 2020-07-29 21:27:04 +02:00
sccp_scrc.c sccp: Log missing user and router failure paths 2020-01-17 15:52:24 +01:00
sccp_types.c sccp: Improve logging in sccp_to_xua_opt() 2020-01-17 14:41:53 +01:00
sccp_user.c sccp: Add minimalistic SCMG implementation 2021-02-08 18:11:08 +01:00
sccp_vty.c vty: add attributes to VTY commands indicating when they apply 2020-10-06 22:50:10 +02:00
sua.c xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00
xua_as_fsm.c xua_as_fsm: Only delete a route for an IPA AS if we created one earlier 2021-04-29 21:10:30 +02:00
xua_as_fsm.h osmo_ss7_vty.c: implement 'active' filter for show_cs7_as_cmd 2019-11-14 22:31:40 +00:00
xua_asp_fsm.c xua_asp_fsm: Fix IPA client role 2021-04-29 21:10:30 +02:00
xua_asp_fsm.h introduce public enum osmo_ss7_asp_role for ASP/SG/IPSP 2019-11-05 20:50:37 +00:00
xua_default_lm_fsm.c ss7: Set configured AS traffic mode when sending Routing Key Register msg 2019-10-24 13:23:09 +02:00
xua_internal.h xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00
xua_msg.c xua: introduce xua_msg_get_u32p() helper 2021-02-08 18:11:12 +01:00
xua_rkm.c M3UA: Reject ASP activation + RKM registration for incompatible traffic-mode 2019-11-05 20:50:26 +00:00
xua_shared.c m3ua: Move find_as_for_asp() to shared xua_find_as_for_asp() 2021-02-08 11:42:30 +01:00
xua_snm.c xua_snm: Implement handling of DUPU messages 2021-02-10 19:58:38 +01:00