[MERGED] osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jan 11 11:05:32 UTC 2018


Neels Hofmeyr has submitted this change and it was merged.

Change subject: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn
......................................................................


gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn

On 34c3, osmo-sgsn keeps restarting. At least once, it hits the assertion that
this patch replaces with an error message, to not disrupt operation.

Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81
---
M src/gprs/gprs_llc.c
1 file changed, 9 insertions(+), 2 deletions(-)

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

Objections:
  Max: I would prefer this is not merged as is



diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 1a7cf3d..6c92f83 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -372,8 +372,15 @@
 		dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
 
 		/* make sure we only send it to the right llme */
-		OSMO_ASSERT(msgb_tlli(msg) == mmctx->gb.llme->tlli
-				|| msgb_tlli(msg) == mmctx->gb.llme->old_tlli);
+		if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli
+		      || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) {
+			LOGP(DLLC, LOGL_ERROR,
+			     "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:"
+			     " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n",
+			     msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli);
+			msgb_free(msg);
+			return -EINVAL;
+		}
 	}
 	memcpy(&dup.qos_profile, qos_profile_default,
 		sizeof(qos_profile_default));

-- 
To view, visit https://gerrit.osmocom.org/5662
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list