Change in libosmocore[master]: gprs_ns2: nsvc_fsm: reorder notification st_alive_on_enter()

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
Tue Apr 6 14:30:19 UTC 2021


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

Change subject: gprs_ns2: nsvc_fsm: reorder notification st_alive_on_enter()
......................................................................

gprs_ns2: nsvc_fsm: reorder notification st_alive_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(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  daniel: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified



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: 3
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210406/69104e13/attachment.htm>


More information about the gerrit-log mailing list