Project

General

Profile

Actions

Bug #5329

closed

osmo_wqueue_enqueue*() doesn't msgb_free in case enqueing fails

Added by laforge over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
11/25/2021
Due date:
% Done:

90%

Spec Reference:

Description

This is a somewhat questionable API decision and we need to audit our code base accordingly.

functions that do it correctly

  • ctrl_cmd_send
  • osmo-bsc:bsc_rf_ctrl.c:send_resp
  • osmo-bsc:meas_feed.c:process_meas_rep
  • osmo-mgw:mgcp_client_tx
  • osmo-msc:smpp_smsc.c:pack_and_send
  • osmo-msc:smpp_mirror.c:pack_and_send
  • osmo-pcap:osmo_client_network.c:write_data
  • osmo-pcu:osmo-bts-*/*_l1_if.c
  • osmcoom-bb:layer23:osmo_send_l1
  • osmocom-bb:layer23:sap_fsm:sap_send_msgb

functions that get it wrong

  • osmo-bts:osmo-bts-{lc15,oc2g,octphy}/*_l1_if.c:ph_tch_req
  • osmo-iuh/src/tests/hnb-test.c (just a test cse)

functions that pass return value of osmo_wqueue_enqueue* up to caller

We need to trace the usage of those...

  • gsmtap_sendmsg
  • tcap_tp_udp_unitdata_req
  • tcap_scXp_n_unitdata_req
  • osmo-el2tpd:l2tp_socket_enqueue

Related issues

Related to libosmocore - Bug #5328: log_file_msg related memory leakResolvedlaforge11/25/2021

Actions
Actions #1

Updated by laforge over 2 years ago

  • Related to Bug #5328: log_file_msg related memory leak added
Actions #2

Updated by laforge over 2 years ago

Actions #3

Updated by laforge over 2 years ago

  • % Done changed from 10 to 20

laforge wrote:

functions that get it wrong

  • osmo-bts:osmo-bts-{lc15,oc2g,octphy}/*_l1_if.c:ph_tch_req

Fixed in https://gerrit.osmocom.org/c/osmo-bts/+/26362

Actions #4

Updated by laforge over 2 years ago

  • Description updated (diff)
Actions #5

Updated by laforge over 2 years ago

  • % Done changed from 20 to 90

reviewed all occurrences and submitted fixes, even for cases where functions pass on the return value.

Actions #6

Updated by laforge over 2 years ago

  • Status changed from In Progress to Resolved

patches merged

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)