Change in osmo-pcu[master]: gprs_bssgp_pdu: ensure only known BVCI can be resetted by the 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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Mon Feb 22 01:11:07 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23014 )


Change subject: gprs_bssgp_pdu: ensure only known BVCI can be resetted by the SGSN
......................................................................

gprs_bssgp_pdu: ensure only known BVCI can be resetted by the SGSN

Related: SYS#5354
Change-Id: I04e36ce4a29e51d85e67a0d3a81aa0e1eb9e9c08
---
M src/gprs_bssgp_pcu.c
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/23014/1

diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c
index 9f0afe8..deb7711 100644
--- a/src/gprs_bssgp_pcu.c
+++ b/src/gprs_bssgp_pcu.c
@@ -415,6 +415,7 @@
 	struct tlv_parsed tp;
 	enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type;
 	uint16_t ns_bvci = msgb_bvci(msg), nsei = msgb_nsei(msg);
+	uint16_t bvci;
 	int data_len;
 	int rc = 0;
 	struct bssgp_bvc_ctx *bctx;
@@ -456,6 +457,13 @@
 	}
 
 	if (pdu_type == BSSGP_PDUT_BVC_RESET) {
+		if (ns_bvci != BVCI_SIGNALLING || !TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
+			return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, msg);
+
+		bvci = tlvp_val16be(&tp, BSSGP_IE_BVCI);
+		if (bvci != the_pcu->bssgp.bctx->bvci)
+			return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, NULL, msg);
+
 		return bssgp_rcvmsg(msg);
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/23014
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I04e36ce4a29e51d85e67a0d3a81aa0e1eb9e9c08
Gerrit-Change-Number: 23014
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210222/51aae80d/attachment.htm>


More information about the gerrit-log mailing list