Change in osmo-bts[master]: OML: Reject segmented OML messages

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Feb 12 20:02:16 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12871 )

Change subject: OML: Reject segmented OML messages
......................................................................

OML: Reject segmented OML messages

TS 12.21 describes segmenting of OML messages using placement
fist/middle/last and the "sequence' number of the OML header. We don't
implement this and hence must ignore or reject any related messages.

Before this patch however, we simply treated such segments as if they
were a complete OML message.  Let's fix that.

Change-Id: Idd42cf4edc1bf9ab366853bd9b0f7afd9c060910
Closes: OS#3795
---
M src/common/oml.c
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/common/oml.c b/src/common/oml.c
index c98ba9c..d389e29 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1424,7 +1424,7 @@
 	struct abis_om_hdr *oh = msgb_l2(msg);
 	int ret = 0;
 
-	if (msgb_l2len(msg) < 1) {
+	if (msgb_l2len(msg) < sizeof(*oh)) {
 		oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
 					 "OML message too short\n");
 		msgb_free(msg);
@@ -1432,6 +1432,14 @@
 	}
 	msg->l3h = (unsigned char *)oh + sizeof(*oh);
 
+	/* We don't implement de-segmentation of segmented OML messages */
+	if (oh->placement != ABIS_OM_PLACEMENT_ONLY || oh->sequence != 0) {
+		oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+					 "Unsupported segmented O&M message\n");
+		msgb_free(msg);
+		return -EIO;
+	}
+
 	switch (oh->mdisc) {
 	case ABIS_OM_MDISC_FOM:
 		if (msgb_l2len(msg) < sizeof(*oh)) {

-- 
To view, visit https://gerrit.osmocom.org/12871
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idd42cf4edc1bf9ab366853bd9b0f7afd9c060910
Gerrit-Change-Number: 12871
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190212/1e27d603/attachment.htm>


More information about the gerrit-log mailing list