Change in libosmocore[master]: gprs_ns2: NSVC fsm: reorder notification on_enter()

lynxis lazus gerrit-no-reply at lists.osmocom.org
Thu Apr 1 14:32:56 UTC 2021


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


Change subject: gprs_ns2: NSVC fsm: reorder notification on_enter()
......................................................................

gprs_ns2: NSVC fsm: reorder notification on_enter()

The start_procedure() can't be called after ns2_nse_notify_unblocked()
because ns2_nse_notify_unblocked() might free the nsvc.
Otherwise the fsm will do use-after-free on the NSVC memory.

Related: SYS#5416
Change-Id: If97dfd123eefd71fc6c3fe886a243a21784aeeb4
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/23565/1

diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index a8cb570..85cd2ad 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -460,8 +460,8 @@
 	if (old_state != GPRS_NS2_ST_RECOVERING)
 		priv->N = 0;
 
-	ns2_nse_notify_unblocked(priv->nsvc, false);
 	start_test_procedure(fi, true);
+	ns2_nse_notify_unblocked(priv->nsvc, false);
 }
 
 static const struct osmo_fsm_state ns2_vc_states[] = {

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If97dfd123eefd71fc6c3fe886a243a21784aeeb4
Gerrit-Change-Number: 23565
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/20210401/dbb7fb6d/attachment.htm>


More information about the gerrit-log mailing list