Attention is currently required from: osmith, Hoernchen, neels, laforge, pespin, fixeria.
Hello osmith, Jenkins Builder, Hoernchen, neels, pespin, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30934
to look at the new patch set (#16).
Change subject: Add osmo_io with initial poll backend
......................................................................
Add osmo_io with initial poll backend
* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes
Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
---
M TODO-RELEASE
M include/osmocom/core/Makefile.am
M include/osmocom/core/logging.h
A include/osmocom/core/osmo_io.h
M src/core/Makefile.am
M src/core/libosmocore.map
M src/core/logging.c
A src/core/osmo_io.c
A src/core/osmo_io_internal.h
A src/core/osmo_io_poll.c
M tests/logging/logging_vty_test.vty
11 files changed, 1,064 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/30934/16
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 16
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: osmith, Hoernchen, neels, laforge, pespin, fixeria.
Hello osmith, Jenkins Builder, Hoernchen, neels, pespin, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30934
to look at the new patch set (#15).
Change subject: Add osmo_io with initial poll backend
......................................................................
Add osmo_io with initial poll backend
* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes
Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
---
M TODO-RELEASE
M include/osmocom/core/Makefile.am
M include/osmocom/core/logging.h
A include/osmocom/core/osmo_io.h
M src/core/Makefile.am
M src/core/libosmocore.map
M src/core/logging.c
A src/core/osmo_io.c
A src/core/osmo_io_internal.h
A src/core/osmo_io_poll.c
M tests/logging/logging_vty_test.vty
11 files changed, 1,065 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/30934/15
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 15
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge.
arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32649 )
Change subject: core: Check return value of osmo_fd_register()
......................................................................
Patch Set 2:
(1 comment)
File src/core/tun.c:
https://gerrit.osmocom.org/c/libosmocore/+/32649/comment/1ba41d82_3ff144a7
PS1, Line 404: g
> Don't you have to un-register the tundev->netdev that was successfully registered in osmo_netdev_reg […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32649
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I15bb456c42d5033c9cf4c0937df22fa02b6a6086
Gerrit-Change-Number: 32649
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 08 May 2023 22:41:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
Attention is currently required from: arehbein.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/32649
to look at the new patch set (#2).
Change subject: core: Check return value of osmo_fd_register()
......................................................................
core: Check return value of osmo_fd_register()
Change-Id: I15bb456c42d5033c9cf4c0937df22fa02b6a6086
---
M src/core/tun.c
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/32649/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32649
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I15bb456c42d5033c9cf4c0937df22fa02b6a6086
Gerrit-Change-Number: 32649
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-MessageType: newpatchset
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32668 )
Change subject: RTP input, FR & EFR: preen incoming payloads for SID errors
......................................................................
RTP input, FR & EFR: preen incoming payloads for SID errors
Those network elements which receive a stream of codec frames that
may come from the uplink of GSM call A and which are responsible
for preparing the frame stream for the downlink of GSM call B
(such as OsmoBTS receiving RTP and feeding DL to its PHY) must be
prepared for the possibility that their incoming frame stream may
contain corrupted SID frames, presumably from bit errors on radio
link A. Per the rules of section 6.1.1 of GSM 06.31 for FR and
GSM 06.81 for EFR, SID frames with just one errored bit are still
to be accepted as valid, whereas frames with more corrupted bits
which are still recognizable as SID are classified as invalid SID.
In the case of a TrFO call, the entity switching from leg A UL to
leg B DL is responsible for *not* transmitting invalid SID frames
on the destination leg (they should be treated like BFIs), and any
deemed-valid SID frames that are forwarded should be preened,
correcting that one bit error they may exhibit. Implement this
functionality in OsmoBTS.
Change-Id: I89df2f12c49dd5378667cf149d19bde654f80134
---
M src/common/l1sap.c
M src/osmo-bts-omldummy/Makefile.am
2 files changed, 68 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/32668/1
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index a7eb830..f24bc2f 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -37,6 +37,8 @@
#include <osmocom/core/gsmtap_util.h>
#include <osmocom/core/utils.h>
+#include <osmocom/codec/codec.h>
+
#include <osmocom/trau/osmo_ortp.h>
#include <osmo-bts/logging.h>
@@ -1241,6 +1243,24 @@
return true;
}
+static bool rtppayload_validate_fr(struct msgb *msg)
+{
+ if (msg->len != GSM_FR_BYTES)
+ return false;
+ if ((msg->data[0] & 0xF0) != 0xD0)
+ return false;
+ return osmo_fr_sid_preen(msg->data);
+}
+
+static bool rtppayload_validate_efr(struct msgb *msg)
+{
+ if (msg->len != GSM_EFR_BYTES)
+ return false;
+ if ((msg->data[0] & 0xF0) != 0xC0)
+ return false;
+ return osmo_efr_sid_preen(msg->data);
+}
+
static bool rtppayload_is_valid(struct gsm_lchan *lchan, struct msgb *resp_msg)
{
/* If rtp continuous-streaming is enabled, we shall emit RTP packets
@@ -1255,16 +1275,27 @@
if (resp_msg->len == 0)
return false;
- /* Avoid forwarding bw-efficient AMR to lower layers, most bts models
- * don't support it. */
- if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR &&
- !rtppayload_is_octet_aligned(resp_msg->data, resp_msg->len)) {
- LOGPLCHAN(lchan, DL1P, LOGL_NOTICE,
- "RTP->L1: Dropping unexpected AMR encoding (bw-efficient?) %s\n",
- osmo_hexdump(resp_msg->data, resp_msg->len));
- return false;
+ switch (lchan->tch_mode) {
+ case GSM48_CMODE_SPEECH_V1:
+ if (lchan->type == GSM_LCHAN_TCH_F)
+ return rtppayload_validate_fr(resp_msg);
+ else
+ return true; /* FIXME: implement preening for HR1 */
+ case GSM48_CMODE_SPEECH_EFR:
+ return rtppayload_validate_efr(resp_msg);
+ case GSM48_CMODE_SPEECH_AMR:
+ /* Avoid forwarding bw-efficient AMR to lower layers,
+ * most bts models don't support it. */
+ if (!rtppayload_is_octet_aligned(resp_msg->data, resp_msg->len)) {
+ LOGPLCHAN(lchan, DL1P, LOGL_NOTICE,
+ "RTP->L1: Dropping unexpected AMR encoding (bw-efficient?) %s\n",
+ osmo_hexdump(resp_msg->data, resp_msg->len));
+ return false;
+ }
+ return true;
+ default:
+ return true;
}
- return true;
}
/* TCH-RTS-IND prim received from bts model */
diff --git a/src/osmo-bts-omldummy/Makefile.am b/src/osmo-bts-omldummy/Makefile.am
index 81da29b..f7a0504 100644
--- a/src/osmo-bts-omldummy/Makefile.am
+++ b/src/osmo-bts-omldummy/Makefile.am
@@ -20,6 +20,7 @@
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOTRAU_LIBS) \
$(LIBOSMONETIF_LIBS) \
+ $(LIBOSMOCODEC_LIBS) \
-ldl \
$(NULL)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32668
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I89df2f12c49dd5378667cf149d19bde654f80134
Gerrit-Change-Number: 32668
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-MessageType: newchange
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32664 )
Change subject: fix use-after-free in ipaccess_bts_keepalive_fsm_alloc()
......................................................................
fix use-after-free in ipaccess_bts_keepalive_fsm_alloc()
In ipaccess_bts_keepalive_fsm_alloc() we allocate a keepalive FSM
instance as a child of the respective struct ipa_client_conn, and
store the pointer to the respective struct e1inp_ts.
+ struct e1inp_line
|
---+ struct ipaccess_line (void *driver_data)
| |
| ---+ struct ipa_client_conn *ipa_cli[NUM_E1_TS] // <-- parent
|
---+ struct e1inp_ts ts[NUM_E1_TS]
| |
| ---+ .driver.ipaccess.ka_fsm // <-- pointer
When an ipaccess connection (be it OML or RSL) goes down and then
up again, for instance if the BSC gets restarted, osmo-bts crashes.
The problem is that struct ipa_client_conn gets free()ed before the
associated FSM instance gets terminated:
* e1inp_ipa_bts_rsl_connect_n() is called
** calling e1inp_ipa_bts_rsl_close_n()
*** this function free()s struct ipa_client_conn
*** (!) as well as the struct osmo_fsm_inst (talloc child)
** calling ipaccess_bts_keepalive_fsm_alloc()
*** calling ipaccess_keepalive_fsm_cleanup()
**** accessing free()d e1i_ts->driver.ipaccess.ka_fsm
**** BOOOM! segmentation fault
Fix this by calling ipaccess_keepalive_fsm_cleanup() before free()ing
the associated struct ipa_client_conn.
Note that ipaccess_bsc_keepalive_fsm_alloc() is not affected because
it's allocating keepalive FSMs using the global tall_ipa_ctx.
Change-Id: Ic56c4b5b7b24b63104908a0c24f2f645ba4c5c1b
Related: SYS#6438
(cherry picked from commit f6bde0f521155f1d2a073181cfca97df83de2684)
---
M src/input/ipaccess.c
1 file changed, 50 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 8a52591..418606e 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -192,7 +192,7 @@
struct e1inp_line *line = e1i_ts->line;
struct osmo_fsm_inst *ka_fsm;
- ipaccess_keepalive_fsm_cleanup(e1i_ts);
+ OSMO_ASSERT(e1i_ts->driver.ipaccess.ka_fsm == NULL);
if (!line->ipa_kap)
return;
@@ -1207,6 +1207,7 @@
int e1inp_ipa_bts_rsl_close_n(struct e1inp_line *line, uint8_t trx_nr)
{
struct ipaccess_line *il;
+ struct e1inp_ts *e1i_ts;
if (E1INP_SIGN_RSL+trx_nr-1 >= NUM_E1_TS) {
LOGP(DLINP, LOGL_ERROR,
@@ -1218,6 +1219,9 @@
if (!il)
return 0; /* Nothing to do, no lines created */
+ e1i_ts = e1inp_line_ipa_rsl_ts(line, trx_nr);
+ ipaccess_keepalive_fsm_cleanup(e1i_ts);
+
if (il->ipa_cli[1 + trx_nr]) {
ipa_client_conn_close(il->ipa_cli[1 + trx_nr]);
ipa_client_conn_destroy(il->ipa_cli[1 + trx_nr]);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32664
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: rel-1.4.1
Gerrit-Change-Id: Ic56c4b5b7b24b63104908a0c24f2f645ba4c5c1b
Gerrit-Change-Number: 32664
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged