Pau Espin Pedrol cb4e11f984 cbsp: Fix heap-use-after-free closing cli conn in connecting state
if conn is not in STREAM_CLI_STATE_CONNECTED state, it won't call disconnect_cb during
osmo_stream_cli_destroy(), hence the osmo-cbc pointers holding are not
nullified correctly.

"""
20220801174147247 DCBSP NOTICE ttcn3-bsc-server: Disconnected. (cbsp_link.c:101)
20220801174147247 DCBSP NOTICE ttcn3-bsc-server: Reconnecting... (cbsp_link.c:102)
20220801174147247 DLINP INFO [WAIT_RECONNECT] osmo_stream_cli_reconnect(): retrying in 5 seconds... (stream.c:287)
20220801174152235 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: Timeout of T3 (fsm.c:317)
20220801174152236 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: timer_cb requested termination (fsm.c:327)
20220801174152236 DCBSP DEBUG CBSP-Link[0x612000002c20]{RESET_PENDING}: Terminating (cause = OSMO_FSM_TERM_TIMEOUT) (fsm.c:332)
=================================================================
==17==ERROR: AddressSanitizer: heap-use-after-free on address 0x6180000024f0 at pc 0x7fbd28a05d01 bp 0x7ffe247352b0 sp 0x7ffe247352a8
READ of size 4 at 0x6180000024f0 thread T0
    #0 0x7fbd28a05d00 in osmo_stream_cli_close /tmp/libosmo-netif/src/stream.c:307
    #1 0x7fbd28a0a5b3 in osmo_stream_cli_destroy /tmp/libosmo-netif/src/stream.c:714
    #2 0x55c3534a0322 in cbc_cbsp_link_close /tmp/osmo-cbc/src/cbsp_link.c:356
    #3 0x55c3534a16e1 in cbsp_link_fsm_cleanup /tmp/osmo-cbc/src/cbsp_link_fsm.c:199
    #4 0x7fbd28bf5085 in _osmo_fsm_inst_term /tmp/libosmocore/src/fsm.c:947
    #5 0x7fbd28be6881 in fsm_tmr_cb /tmp/libosmocore/src/fsm.c:332
    #6 0x7fbd28bc70ab in osmo_timers_update /tmp/libosmocore/src/timer.c:269
    #7 0x7fbd28bcba5b in _osmo_select_main /tmp/libosmocore/src/select.c:394
    #8 0x7fbd28bcbb31 in osmo_select_main /tmp/libosmocore/src/select.c:438
    #9 0x55c35348bce8 in main /tmp/osmo-cbc/src/cbc_main.c:314
    #10 0x7fbd27a4cd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d09)
    #11 0x55c353488ce9 in _start (/usr/local/bin/osmo-cbc+0x68ce9)
"""

Change-Id: Ic13578e958345207892465644b5e1f28537c032d
2022-08-01 20:36:49 +02:00
2022-07-29 14:49:30 +02:00
2022-07-18 13:57:04 +00:00
2022-07-15 09:14:07 +00:00
2022-07-18 13:57:04 +00:00
2022-07-15 15:53:35 +02:00

osmo-cbc - Osmocom Cell Broadcast Centre

This repository contains a C-language implementation of a minimal 3GPP Cell Broadcast Centre (CBC). It is part of the Osmocom Open Source Mobile Communications project.

A Cell Broadcast Centre is the central network element of a cellular network for distribution of Cell Broadcast and Emergency messages.

This code implements

  • the CBSP protocol on the CBC-BSC interface
  • a custom HTTP/REST based interface for external users to create/delete CBS messages

We plan to add support for the following features in the future:

  • the SABP protocol on the CBC-RNC (or CBC-HNBGW) interface for UMTS support
  • the SBcAP protocol on the CBC-MME interface for LTE support

Homepage

The official homepage of the project is https://osmocom.org/projects/osmo-cbc/wiki

GIT Repository

You can clone from the official osmo-cbc.git repository using

git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc

There is a web interface at https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc

Documentation

User Manuals and VTY reference manuals are [optionally] built in PDF form as part of the build process.

Pre-rendered PDF version of the current "master" can be found at User Manual as well as the VTY Reference Manual for osmo-cbc

Mailing List

Discussions related to osmo-cbc are happening on the openbsc@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/openbsc for subscription options and the list archive.

Please observe the Osmocom Mailing List Rules when posting.

Contributing

Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards

We us a gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details

The current patch queue for osmo-cbc can be seen at https://gerrit.osmocom.org/#/q/project:osmo-cbc+status:open

Description
Osmocom Cell Broadcast Centre
Readme 1.8 MiB
Languages
C 97.8%
Makefile 1.1%
Shell 0.4%
M4 0.4%
Python 0.3%