Change in libosmocore[master]: gprs_ns2: also prevent recursive events when SGSN side cleans up

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
Fri Sep 3 23:26:42 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/25343 )


Change subject: gprs_ns2: also prevent recursive events when SGSN side cleans up
......................................................................

gprs_ns2: also prevent recursive events when SGSN side cleans up

When cleaning up the SGSN side (e.g. receiving a SNS SIZE PDU) the
clean up will result in a use-after-free bug when the SGSN side is still
alive.

Change-Id: I0f57dd0577d1fc7bd270f58e15f6f22eb130ef59
---
M src/gb/gprs_ns2_sns.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/25343/1

diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 3eff0f3..281f908 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -2732,6 +2732,7 @@
 	ns2_clear_procedures(gss);
 	ns2_clear_elems(&gss->local);
 	ns2_clear_elems(&gss->remote);
+	gss->block_no_nsvc_events = true;
 	llist_for_each_entry_safe(nsvc, nsvc2, &gss->nse->nsvc, list) {
 		/* Ignore the NSVC over which the SIZE PDU got received */
 		if (size_nsvc && size_nsvc == nsvc)
@@ -2739,6 +2740,7 @@
 
 		gprs_ns2_free_nsvc(nsvc);
 	}
+	gss->block_no_nsvc_events = false;
 }
 
 static void ns2_sns_st_sgsn_unconfigured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0f57dd0577d1fc7bd270f58e15f6f22eb130ef59
Gerrit-Change-Number: 25343
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/20210903/def6abe6/attachment.htm>


More information about the gerrit-log mailing list