-
-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMF] Fix crash when gNB disconnects in middle of SBI client transaction #2134
Conversation
There is another approach to solve this issue, by checking if RAN UE context is already removed, before dispatching any SBI client events to GMM SM. But not sure of any possible side effects of this generalized approach. What do you guys think?
|
@bmeglicit It would be nice to be able to locate where these issues are occurring. We suggest the following locations: diff --git a/src/amf/sbi-path.c b/src/amf/sbi-path.c
index 4c31012f4..237724d25 100644
--- a/src/amf/sbi-path.c
+++ b/src/amf/sbi-path.c
@@ -95,10 +95,16 @@ int amf_ue_sbi_discover_and_send(
int r;
int rv;
ogs_sbi_xact_t *xact = NULL;
+ ran_ue_t *ran_ue = NULL;
ogs_assert(service_type);
- ogs_assert(amf_ue);
ogs_assert(build);
+ ogs_assert(amf_ue);
+ ran_ue = ran_ue_cycle(amf_ue->ran_ue);
+ if (!ran_ue) {
+ ogs_error("NG context has already been removed");
+ return OGS_NOTFOUND;
+ }
xact = ogs_sbi_xact_add(
&amf_ue->sbi, service_type, discovery_option,
Please let me know if you have any idea. Thanks a lot! |
Hi, This issue is encountered in the function Regards |
8fca36f
to
efd7ff9
Compare
@bmeglicit Even so, I don't think it is a good idea to add a check routine directly to amf_ue_is_rat_restricted(). How about the following modification? $ diff --git a/src/amf/nudm-handler.c b/src/amf/nudm-handler.c
index 71f3f0b9b..4774fd13c 100644
--- a/src/amf/nudm-handler.c
+++ b/src/amf/nudm-handler.c
@@ -32,6 +32,12 @@ int amf_nudm_sdm_handle_provisioned(
SWITCH(recvmsg->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
+ ran_ue_t *ran_ue = ran_ue_cycle(amf_ue->ran_ue);
+ if (!ran_ue) {
+ ogs_error("NG context has already been removed");
+ return OGS_ERROR;
+ }
+
if (recvmsg->AccessAndMobilitySubscriptionData) {
OpenAPI_list_t *gpsiList =
recvmsg->AccessAndMobilitySubscriptionData->gpsis;
You can add this check routine to all the function that uses amf_ue_is_rat_restricted() if needed.
Please let me know if you have any different idea. Thanks a lot! |
efd7ff9
to
23bdf51
Compare
|
23bdf51
to
e63471b
Compare
@bmeglicit You made a great job. Thank you so much! |
Thank you! |
In case that gNB abruptly disconnects right in the middle of SBI client transaction (AMF sends a SBI request to another NF, and waits for response), AMF would crash because the 'ran_ue' context is already removed from the 'amf_ue' context.
The issue can easily be reproduced with following patch to simulate heavy load on UDM: