[PATCH 2/3] gsm_04_08.c: Some spoofing protection against two location

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/OpenBSC@lists.osmocom.org/.

Holger Freyther zecke at selfish.org
Fri Jun 5 02:17:21 UTC 2009


Do not allow two location updating requests at the same time on the
same lchan. Such an event is certainly spoofed and can confuse the
internal logic of the application. Prevent that.
---
 src/gsm_04_08.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index a91ef7a..18371b5 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -563,6 +563,12 @@ static int mm_rx_loc_upd_req(struct msgb *msg)
 	DEBUGP(DMM, "LUPDREQ: mi_type=0x%02x MI(%s) type=%s\n", mi_type, mi_string,
 		lupd_name(lu->type));
 
+	/* two location updating request on the same lchan... *spoof* */
+	if (lchan->loc_operation) {
+		gsm0408_loc_upd_rej(lchan, GSM48_REJECT_PROTOCOL_ERROR);
+		return 0;
+	}
+
 	allocate_loc_updating_req(lchan);
 
 	switch (mi_type) {
-- 
1.6.3.1






More information about the OpenBSC mailing list