From 7278714133422cee46c32c7523f81ec2cecad9e2 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Sat, 25 Nov 2023 21:21:23 +0900 Subject: [PATCH] [AMF] Fixed Nudm_UECM_Registration crash (#2733) 1. UE sends RegistrationRequest to AMF. 2. AMF sends Nudm_UECM_Registration to UDM. 3. UE sends RegistrationRequest to AMF. 4. GMM state is gmm_state_authentication 5. UDM sends Nudm_UECM_Registration response to AMF. 6. AMF crashs since no Handler in gmm_state_authentication state --- src/amf/gmm-sm.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/amf/gmm-sm.c b/src/amf/gmm-sm.c index 9ce0a8952..d94096af5 100644 --- a/src/amf/gmm-sm.c +++ b/src/amf/gmm-sm.c @@ -1716,6 +1716,39 @@ void gmm_state_authentication(ogs_fsm_t *s, amf_event_t *e) END break; + CASE(OGS_SBI_SERVICE_NAME_NUDM_UECM) + if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED && + sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT && + sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) { + ogs_error("[%s] HTTP response error [%d]", + amf_ue->supi, sbi_message->res_status); + } + + SWITCH(sbi_message->h.resource.component[1]) + CASE(OGS_SBI_RESOURCE_NAME_REGISTRATIONS) + SWITCH(sbi_message->h.method) + CASE(OGS_SBI_HTTP_METHOD_PUT) + /* + * Issue #2733 + * + * We need to ignore this message in this state. + */ + ogs_error("[%s] Ignore SBI message", amf_ue->supi); + break; + DEFAULT + ogs_error("[%s] Invalid HTTP method [%s]", + amf_ue->suci, sbi_message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + sbi_message->h.resource.component[1]); + ogs_assert_if_reached(); + END + break; + DEFAULT ogs_error("Invalid service name [%s]", sbi_message->h.service.name); ogs_assert_if_reached();