Projects
osmocom:nightly
open5gs
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 1003
View file
open5gs_2.7.2.4636.10b1.202503202026.dsc
Deleted
@@ -1,39 +0,0 @@ -Format: 3.0 (native) -Source: open5gs -Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg -Architecture: any -Version: 2.7.2.4636.10b1.202503202026 -Maintainer: Harald Welte <laforge@gnumonks.org> -Uploaders: Sukchan Lee <acetcom@gmail.com> -Homepage: https://open5gs.org -Standards-Version: 4.3.0 -Vcs-Browser: https://github.com/open5gs/open5gs -Vcs-Git: git://github.com/open5gs/open5gs -Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn-dev | libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev -Package-List: - open5gs deb net optional arch=any - open5gs-amf deb net optional arch=any - open5gs-ausf deb net optional arch=any - open5gs-bsf deb net optional arch=any - open5gs-common deb net optional arch=any - open5gs-dbg deb net optional arch=any - open5gs-hss deb net optional arch=any - open5gs-mme deb net optional arch=any - open5gs-nrf deb net optional arch=any - open5gs-nssf deb net optional arch=any - open5gs-pcf deb net optional arch=any - open5gs-pcrf deb net optional arch=any - open5gs-scp deb net optional arch=any - open5gs-sepp deb net optional arch=any - open5gs-sgwc deb net optional arch=any - open5gs-sgwu deb net optional arch=any - open5gs-smf deb net optional arch=any - open5gs-udm deb net optional arch=any - open5gs-udr deb net optional arch=any - open5gs-upf deb net optional arch=any -Checksums-Sha1: - 699e864e26d4c920550b6c6ca044e463fdf791d4 14529328 open5gs_2.7.2.4636.10b1.202503202026.tar.xz -Checksums-Sha256: - 4308f0f18f9421ddb9f1d1a256940efc9256bd4f20ea4046212d07aacb357c65 14529328 open5gs_2.7.2.4636.10b1.202503202026.tar.xz -Files: - 3d82c380d4cf83cf473f5cf2cadaf3c5 14529328 open5gs_2.7.2.4636.10b1.202503202026.tar.xz
View file
open5gs_2.7.2.4639.a551.202503212026.dsc
Added
@@ -0,0 +1,39 @@ +Format: 3.0 (native) +Source: open5gs +Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg +Architecture: any +Version: 2.7.2.4639.a551.202503212026 +Maintainer: Harald Welte <laforge@gnumonks.org> +Uploaders: Sukchan Lee <acetcom@gmail.com> +Homepage: https://open5gs.org +Standards-Version: 4.3.0 +Vcs-Browser: https://github.com/open5gs/open5gs +Vcs-Git: git://github.com/open5gs/open5gs +Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn-dev | libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev +Package-List: + open5gs deb net optional arch=any + open5gs-amf deb net optional arch=any + open5gs-ausf deb net optional arch=any + open5gs-bsf deb net optional arch=any + open5gs-common deb net optional arch=any + open5gs-dbg deb net optional arch=any + open5gs-hss deb net optional arch=any + open5gs-mme deb net optional arch=any + open5gs-nrf deb net optional arch=any + open5gs-nssf deb net optional arch=any + open5gs-pcf deb net optional arch=any + open5gs-pcrf deb net optional arch=any + open5gs-scp deb net optional arch=any + open5gs-sepp deb net optional arch=any + open5gs-sgwc deb net optional arch=any + open5gs-sgwu deb net optional arch=any + open5gs-smf deb net optional arch=any + open5gs-udm deb net optional arch=any + open5gs-udr deb net optional arch=any + open5gs-upf deb net optional arch=any +Checksums-Sha1: + 723a292504dbe56f5a200759cd1dcb597053268d 14529788 open5gs_2.7.2.4639.a551.202503212026.tar.xz +Checksums-Sha256: + 4db819529299415c06177a8e8ad29b071f8bd8087267564fac04187c348c62a9 14529788 open5gs_2.7.2.4639.a551.202503212026.tar.xz +Files: + 0d4fea5c1b23015a6460ac647e099017 14529788 open5gs_2.7.2.4639.a551.202503212026.tar.xz
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/.tarball-version -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.7.2.4636-10b1.202503202026 +2.7.2.4639-a551.202503212026
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/debian/changelog -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.7.2.4636.10b1.202503202026) unstable; urgency=medium +open5gs (2.7.2.4639.a551.202503212026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Thu, 20 Mar 2025 20:27:57 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 21 Mar 2025 20:27:54 +0000 open5gs (2.7.2) unstable; urgency=medium
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/lib/nas/common/conv.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/lib/nas/common/conv.c
Changed
@@ -131,56 +131,66 @@ gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_2_SS; gprs_timer->value = timer_value / 2; } else { - if (timer_value%60 != 0) { - ogs_error("Not multiples of 1 minute"); + if (timer_value%30 != 0) { + ogs_error("Not multiples of 30 seconds"); return OGS_ERROR; } - timer_value /= 60; /* multiples of 1 minute */ + timer_value /= 30; /* multiples of 30 seconds */ if (timer_value <= 31) { - gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_1_MM; + gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_30_SS; gprs_timer->value = timer_value; } else { - if (timer_value%10 != 0) { - ogs_error("Not multiples of decihours(= 10 minutes)"); + if (timer_value%2 != 0) { + ogs_error("Not multiples of 1 minute"); return OGS_ERROR; } - timer_value /= 10; /* multiples of decihours = 10 mintues */ + timer_value /= 2; /* multiples of 1 minute */ if (timer_value <= 31) { - gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_10_MM; + gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_1_MM; gprs_timer->value = timer_value; } else { - if (timer_value%6 != 0) { - ogs_error("Not multiples of 1 hour"); + if (timer_value%10 != 0) { + ogs_error("Not multiples of decihours(= 10 minutes)"); return OGS_ERROR; } - timer_value /= 6; /* multiples of 1 hour */ + timer_value /= 10; /* multiples of decihours = 10 mintues */ if (timer_value <= 31) { - gprs_timer->unit = - OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_1_HH; + gprs_timer->unit = OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_10_MM; gprs_timer->value = timer_value; } else { - if (timer_value%10 != 0) { - ogs_error("Not multiples of 10 hours"); + if (timer_value%6 != 0) { + ogs_error("Not multiples of 1 hour"); return OGS_ERROR; } - timer_value /= 10; /* multiples of 10 hours */ + timer_value /= 6; /* multiples of 1 hour */ if (timer_value <= 31) { gprs_timer->unit = - OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_10_HH; + OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_1_HH; gprs_timer->value = timer_value; } else { - if (timer_value%32 != 0) { + if (timer_value%10 != 0) { ogs_error("Not multiples of 10 hours"); return OGS_ERROR; } - timer_value /= 32; /* multiples of 320 hours */ + timer_value /= 10; /* multiples of 10 hours */ if (timer_value <= 31) { gprs_timer->unit = - OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_320_HH; + OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_10_HH; gprs_timer->value = timer_value; } else { - ogs_error("Overflow!"); - return OGS_ERROR; + if (timer_value%32 != 0) { + ogs_error("Not multiples of 10 hours"); + return OGS_ERROR; + } + timer_value /= 32; /* multiples of 320 hours */ + if (timer_value <= 31) { + gprs_timer->unit = + OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_320_HH; + gprs_timer->value = timer_value; + } else { + ogs_error("Overflow!"); + return OGS_ERROR; + } } } }
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/amf/context.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/amf/context.c
Changed
@@ -2263,20 +2263,37 @@ ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && source_ue->target_ue_id <= OGS_MAX_POOL_ID); - ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && - target_ue->source_ue_id <= OGS_MAX_POOL_ID); source_ue->target_ue_id = OGS_INVALID_POOL_ID; - target_ue->source_ue_id = OGS_INVALID_POOL_ID; + + if (target_ue) { + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && + target_ue->source_ue_id <= OGS_MAX_POOL_ID); + target_ue->source_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Target-UE-ID %d has already been removed " + "(RAN_UE_S1AP_ID%lld AMF_UE_S1AP_ID%lld)", + source_ue->target_ue_id, + (long long)source_ue->ran_ue_ngap_id, + (long long)source_ue->amf_ue_ngap_id); + } else if (ran_ue->source_ue_id >= OGS_MIN_POOL_ID && ran_ue->source_ue_id <= OGS_MAX_POOL_ID) { target_ue = ran_ue; source_ue = ran_ue_find_by_id(ran_ue->source_ue_id); - ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && - source_ue->target_ue_id <= OGS_MAX_POOL_ID); + if (source_ue) { + ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && + source_ue->target_ue_id <= OGS_MAX_POOL_ID); + source_ue->target_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Source-UE-ID %d has already been removed " + "(RAN_UE_S1AP_ID%lld AMF_UE_S1AP_ID%lld)", + target_ue->source_ue_id, + (long long)target_ue->ran_ue_ngap_id, + (long long)target_ue->amf_ue_ngap_id); + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && target_ue->source_ue_id <= OGS_MAX_POOL_ID); - source_ue->target_ue_id = OGS_INVALID_POOL_ID; target_ue->source_ue_id = OGS_INVALID_POOL_ID; } } @@ -2686,60 +2703,61 @@ return 0; } -/* Backup the sensitive security context fields from the UE context */ -void amf_backup_security_context(amf_ue_t *amf_ue, - amf_security_context_t *backup) -{ - ogs_assert(amf_ue); - ogs_assert(backup); - - memcpy(&backup->ue_security_capability, &amf_ue->ue_security_capability, - sizeof(backup->ue_security_capability)); - memcpy(&backup->ue_network_capability, &amf_ue->ue_network_capability, - sizeof(backup->ue_network_capability)); - memcpy(backup->rand, amf_ue->rand, OGS_RAND_LEN); - memcpy(backup->autn, amf_ue->autn, OGS_AUTN_LEN); - memcpy(backup->xres_star, amf_ue->xres_star, OGS_MAX_RES_LEN); - memcpy(backup->abba, amf_ue->abba, OGS_NAS_MAX_ABBA_LEN); - backup->abba_len = amf_ue->abba_len; - memcpy(backup->hxres_star, amf_ue->hxres_star, OGS_MAX_RES_LEN); - memcpy(backup->kamf, amf_ue->kamf, OGS_SHA256_DIGEST_SIZE); - memcpy(backup->knas_int, amf_ue->knas_int, OGS_SHA256_DIGEST_SIZE/2); - memcpy(backup->knas_enc, amf_ue->knas_enc, OGS_SHA256_DIGEST_SIZE/2); - backup->dl_count = amf_ue->dl_count; - backup->ul_count = amf_ue->ul_count.i32; - memcpy(backup->kgnb, amf_ue->kgnb, OGS_SHA256_DIGEST_SIZE); - memcpy(backup->nh, amf_ue->nh, OGS_SHA256_DIGEST_SIZE); - backup->selected_enc_algorithm = amf_ue->selected_enc_algorithm; - backup->selected_int_algorithm = amf_ue->selected_int_algorithm; -} - -/* Restore the sensitive security context fields into the UE context */ -void amf_restore_security_context(amf_ue_t *amf_ue, - const amf_security_context_t *backup) +/* + * Save the sensitive (partial) context fields + * from the UE context into the memento + */ +void amf_ue_save_memento(amf_ue_t *amf_ue, amf_ue_memento_t *memento) +{ + ogs_assert(amf_ue); + ogs_assert(memento); + + memcpy(&memento->ue_security_capability, &amf_ue->ue_security_capability, + sizeof(memento->ue_security_capability)); + memcpy(&memento->ue_network_capability, &amf_ue->ue_network_capability, + sizeof(memento->ue_network_capability)); + memcpy(memento->rand, amf_ue->rand, OGS_RAND_LEN); + memcpy(memento->autn, amf_ue->autn, OGS_AUTN_LEN); + memcpy(memento->xres_star, amf_ue->xres_star, OGS_MAX_RES_LEN); + memcpy(memento->abba, amf_ue->abba, OGS_NAS_MAX_ABBA_LEN); + memento->abba_len = amf_ue->abba_len; + memcpy(memento->hxres_star, amf_ue->hxres_star, OGS_MAX_RES_LEN); + memcpy(memento->kamf, amf_ue->kamf, OGS_SHA256_DIGEST_SIZE); + memcpy(memento->knas_int, amf_ue->knas_int, OGS_SHA256_DIGEST_SIZE/2); + memcpy(memento->knas_enc, amf_ue->knas_enc, OGS_SHA256_DIGEST_SIZE/2); + memento->dl_count = amf_ue->dl_count; + memento->ul_count = amf_ue->ul_count.i32; + memcpy(memento->kgnb, amf_ue->kgnb, OGS_SHA256_DIGEST_SIZE); + memcpy(memento->nh, amf_ue->nh, OGS_SHA256_DIGEST_SIZE); + memento->selected_enc_algorithm = amf_ue->selected_enc_algorithm; + memento->selected_int_algorithm = amf_ue->selected_int_algorithm; +} + +/* Restore the sensitive context fields into the UE context */ +void amf_ue_restore_memento(amf_ue_t *amf_ue, const amf_ue_memento_t *memento) { ogs_assert(amf_ue); - ogs_assert(backup); + ogs_assert(memento); - memcpy(&amf_ue->ue_security_capability, &backup->ue_security_capability, + memcpy(&amf_ue->ue_security_capability, &memento->ue_security_capability, sizeof(amf_ue->ue_security_capability)); - memcpy(&amf_ue->ue_network_capability, &backup->ue_network_capability, + memcpy(&amf_ue->ue_network_capability, &memento->ue_network_capability, sizeof(amf_ue->ue_network_capability)); - memcpy(amf_ue->rand, backup->rand, OGS_RAND_LEN); - memcpy(amf_ue->autn, backup->autn, OGS_AUTN_LEN); - memcpy(amf_ue->xres_star, backup->xres_star, OGS_MAX_RES_LEN); - memcpy(amf_ue->abba, backup->abba, OGS_NAS_MAX_ABBA_LEN); - amf_ue->abba_len = backup->abba_len; - memcpy(amf_ue->hxres_star, backup->hxres_star, OGS_MAX_RES_LEN); - memcpy(amf_ue->kamf, backup->kamf, OGS_SHA256_DIGEST_SIZE); - memcpy(amf_ue->knas_int, backup->knas_int, OGS_SHA256_DIGEST_SIZE/2); - memcpy(amf_ue->knas_enc, backup->knas_enc, OGS_SHA256_DIGEST_SIZE/2); - amf_ue->dl_count = backup->dl_count; - amf_ue->ul_count.i32 = backup->ul_count; - memcpy(amf_ue->kgnb, backup->kgnb, OGS_SHA256_DIGEST_SIZE); - memcpy(amf_ue->nh, backup->nh, OGS_SHA256_DIGEST_SIZE); - amf_ue->selected_enc_algorithm = backup->selected_enc_algorithm; - amf_ue->selected_int_algorithm = backup->selected_int_algorithm; + memcpy(amf_ue->rand, memento->rand, OGS_RAND_LEN); + memcpy(amf_ue->autn, memento->autn, OGS_AUTN_LEN); + memcpy(amf_ue->xres_star, memento->xres_star, OGS_MAX_RES_LEN); + memcpy(amf_ue->abba, memento->abba, OGS_NAS_MAX_ABBA_LEN); + amf_ue->abba_len = memento->abba_len; + memcpy(amf_ue->hxres_star, memento->hxres_star, OGS_MAX_RES_LEN); + memcpy(amf_ue->kamf, memento->kamf, OGS_SHA256_DIGEST_SIZE); + memcpy(amf_ue->knas_int, memento->knas_int, OGS_SHA256_DIGEST_SIZE/2); + memcpy(amf_ue->knas_enc, memento->knas_enc, OGS_SHA256_DIGEST_SIZE/2); + amf_ue->dl_count = memento->dl_count; + amf_ue->ul_count.i32 = memento->ul_count; + memcpy(amf_ue->kgnb, memento->kgnb, OGS_SHA256_DIGEST_SIZE); + memcpy(amf_ue->nh, memento->nh, OGS_SHA256_DIGEST_SIZE); + amf_ue->selected_enc_algorithm = memento->selected_enc_algorithm; + amf_ue->selected_int_algorithm = memento->selected_int_algorithm; } void amf_clear_subscribed_info(amf_ue_t *amf_ue)
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/amf/context.h -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/amf/context.h
Changed
@@ -237,7 +237,7 @@ ogs_pool_id_t amf_ue_id; }; -typedef struct amf_security_context_s { +typedef struct amf_ue_memento_s { /* UE security capability info: supported security features. */ ogs_nas_ue_security_capability_t ue_security_capability; /* UE network capability info: supported network features. */ @@ -296,7 +296,7 @@ /* Selected algorithms (set by UDM/subscription) */ uint8_t selected_enc_algorithm; uint8_t selected_int_algorithm; -} amf_security_context_t; +} amf_ue_memento_t; struct amf_ue_s { ogs_sbi_object_t sbi; @@ -428,11 +428,11 @@ int security_context_available; int mac_failed; - /* flag: 1 = allow restoration of security context, 0 = disallow */ - bool can_restore_security_context; + /* flag: 1 = allow restoration of context, 0 = disallow */ + bool can_restore_context; - /* Backup of security context fields */ - amf_security_context_t sec_backup; + /* Memento of context fields */ + amf_ue_memento_t memento; /* Security Context */ ogs_nas_ue_security_capability_t ue_security_capability; @@ -1085,10 +1085,8 @@ uint8_t amf_selected_int_algorithm(amf_ue_t *amf_ue); uint8_t amf_selected_enc_algorithm(amf_ue_t *amf_ue); -void amf_backup_security_context( - amf_ue_t *amf_ue, amf_security_context_t *backup); -void amf_restore_security_context( - amf_ue_t *amf_ue, const amf_security_context_t *backup); +void amf_ue_save_memento(amf_ue_t *amf_ue, amf_ue_memento_t *memento); +void amf_ue_restore_memento(amf_ue_t *amf_ue, const amf_ue_memento_t *memento); void amf_clear_subscribed_info(amf_ue_t *amf_ue);
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/amf/gmm-sm.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/amf/gmm-sm.c
Changed
@@ -35,6 +35,24 @@ #undef OGS_LOG_DOMAIN #define OGS_LOG_DOMAIN __gmm_log_domain +#define AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s) do { \ + if ((amf_ue)->can_restore_context) { \ + /* Restore context if allowed */ \ + amf_ue_restore_memento((amf_ue), &((amf_ue)->memento)); \ + (amf_ue)->security_context_available = 1; \ + (amf_ue)->mac_failed = 0; \ + if (!OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) \ + OGS_FSM_TRAN((s), &gmm_state_registered); \ + ogs_warn("%s Failure in transaction; restoring context and " \ + "transitioning to REGISTERED.", (amf_ue)->supi); \ + } else { \ + /* Transition to exception state if not allowed */ \ + OGS_FSM_TRAN((s), &gmm_state_exception); \ + ogs_warn("%s Failure in transaction; no context " \ + "restoration.", (amf_ue)->supi); \ + } \ +} while (0) + typedef enum { GMM_COMMON_STATE_DEREGISTERED, GMM_COMMON_STATE_REGISTERED, @@ -43,7 +61,6 @@ static void common_register_state(ogs_fsm_t *s, amf_event_t *e, gmm_common_state_e state); - void gmm_state_initial(ogs_fsm_t *s, amf_event_t *e) { ogs_assert(s); @@ -1281,11 +1298,11 @@ /* If transition is from REGISTERED, allow restoration */ if (state == GMM_COMMON_STATE_REGISTERED) { - amf_ue->can_restore_security_context = 1; - amf_backup_security_context(amf_ue, &amf_ue->sec_backup); + amf_ue->can_restore_context = 1; + amf_ue_save_memento(amf_ue, &amf_ue->memento); } else if (state == GMM_COMMON_STATE_DEREGISTERED) { /* Transition from de-registered: do not restore */ - amf_ue->can_restore_security_context = 0; + amf_ue->can_restore_context = 0; } else ogs_assert_if_reached(); @@ -1331,7 +1348,7 @@ r = nas_5gs_send_registration_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1392,7 +1409,7 @@ ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1405,7 +1422,7 @@ OGS_5GMM_CAUSE_NO_NETWORK_SLICES_AVAILABLE); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1469,7 +1486,7 @@ OGS_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1481,7 +1498,7 @@ r = nas_5gs_send_service_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1491,7 +1508,7 @@ OGS_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1501,7 +1518,7 @@ OGS_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1520,7 +1537,7 @@ r = nas_5gs_send_service_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1536,7 +1553,7 @@ NGAP_CauseProtocol_semantic_error); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1552,7 +1569,7 @@ r = nas_5gs_send_gmm_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1561,7 +1578,7 @@ r = nas_5gs_send_gmm_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1591,7 +1608,7 @@ if (!h.integrity_protected || !SECURITY_CONTEXT_IS_VALID(amf_ue)) { ogs_error("No Security Context"); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1660,7 +1677,7 @@ case OGS_NAS_5GS_UL_NAS_TRANSPORT: if (!h.integrity_protected || !SECURITY_CONTEXT_IS_VALID(amf_ue)) { ogs_error("No Security Context"); - OGS_FSM_TRAN(s, gmm_state_exception); + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); break; } @@ -1740,7 +1757,8 @@ r = nas_5gs_send_authentication_reject(amf_ue); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - goto cleanup; + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); + break; } break; @@ -1804,7 +1822,8 @@ r = nas_5gs_send_authentication_reject(amf_ue); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - goto cleanup; + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); + break; case OGS_NAS_5GS_REGISTRATION_REQUEST: ogs_warn("Registration request"); @@ -1817,7 +1836,8 @@ r = nas_5gs_send_registration_reject(ran_ue, amf_ue, gmm_cause); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - goto cleanup; + AMF_RESTORE_CONTEXT_ON_FAILURE(amf_ue, s); + break; } r = amf_ue_sbi_discover_and_send( @@ -1855,7 +1875,8 @@ r = nas_5gs_send_authentication_reject(amf_ue); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - goto cleanup;
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/mme/emm-sm.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/mme/emm-sm.c
Changed
@@ -37,6 +37,24 @@ #undef OGS_LOG_DOMAIN #define OGS_LOG_DOMAIN __emm_log_domain +#define MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s) do { \ + if ((mme_ue)->can_restore_context) { \ + /* Restore context if allowed */ \ + mme_ue_restore_memento((mme_ue), &((mme_ue)->memento)); \ + (mme_ue)->security_context_available = 1; \ + (mme_ue)->mac_failed = 0; \ + if (!OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) \ + OGS_FSM_TRAN((s), &emm_state_registered); \ + ogs_warn("%s Failure in transaction; restoring context and " \ + "transitioning to REGISTERED.", (mme_ue)->imsi_bcd); \ + } else { \ + /* Transition to exception state if not allowed */ \ + OGS_FSM_TRAN((s), &emm_state_exception); \ + ogs_warn("%s Failure in transaction; no context " \ + "restoration.", (mme_ue)->imsi_bcd); \ + } \ +} while (0) + typedef enum { EMM_COMMON_STATE_DEREGISTERED, EMM_COMMON_STATE_REGISTERED, @@ -45,7 +63,6 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e, emm_common_state_e state); - void emm_state_initial(ogs_fsm_t *s, mme_event_t *e) { ogs_assert(s); @@ -306,11 +323,11 @@ /* If transition is from REGISTERED, allow restoration */ if (state == EMM_COMMON_STATE_REGISTERED) { - mme_ue->can_restore_security_context = 1; - mme_backup_security_context(mme_ue, &mme_ue->sec_backup); + mme_ue->can_restore_context = 1; + mme_ue_save_memento(mme_ue, &mme_ue->memento); } else if (state == EMM_COMMON_STATE_DEREGISTERED) { /* Transition from de-registered: do not restore */ - mme_ue->can_restore_security_context = 0; + mme_ue->can_restore_context = 0; } switch (e->id) { @@ -346,7 +363,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -354,7 +371,7 @@ enb_ue, mme_ue, &message->emm.service_request); if (rv != OGS_OK) { ogs_error("emm_handle_service_request() failed"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -364,7 +381,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -374,7 +391,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -384,7 +401,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -394,7 +411,7 @@ OGS_NAS_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -420,7 +437,7 @@ S1AP_Cause_PR_protocol, S1AP_CauseProtocol_semantic_error); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -431,13 +448,13 @@ &message->emm.identity_response); if (rv != OGS_OK) { ogs_error("emm_handle_identity_response() failed"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } if (!MME_UE_HAVE_IMSI(mme_ue)) { ogs_error("No IMSI"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -459,7 +476,7 @@ enb_ue, mme_ue, &message->emm.attach_request, e->pkbuf); if (rv != OGS_OK) { ogs_error("emm_handle_attach_request() failed"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -494,7 +511,7 @@ OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } } @@ -522,7 +539,7 @@ &message->emm.tracking_area_update_request, e->pkbuf); if (rv != OGS_OK) { ogs_error("emm_handle_tau_request() failed"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -540,7 +557,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } if (message->emm.tracking_area_update_request.presencemask & OGS_NAS_EPS_TRACKING_AREA_UPDATE_REQUEST_OLD_P_TMSI_SIGNATURE_TYPE) @@ -556,7 +573,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -566,7 +583,7 @@ OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -576,7 +593,7 @@ OGS_NAS_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); - OGS_FSM_TRAN(s, &emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -761,7 +778,7 @@ enb_ue, mme_ue, &message->emm.extended_service_request); if (rv != OGS_OK) { ogs_error("emm_handle_extended_service_request() failed"); - OGS_FSM_TRAN(s, emm_state_exception); + MME_RESTORE_CONTEXT_ON_FAILURE(mme_ue, s); break; } @@ -771,7 +788,7 @@
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/mme/mme-context.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/mme/mme-context.c
Changed
@@ -4200,20 +4200,36 @@ ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && source_ue->target_ue_id <= OGS_MAX_POOL_ID); - ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && - target_ue->source_ue_id <= OGS_MAX_POOL_ID); source_ue->target_ue_id = OGS_INVALID_POOL_ID; - target_ue->source_ue_id = OGS_INVALID_POOL_ID; + + if (target_ue) { + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && + target_ue->source_ue_id <= OGS_MAX_POOL_ID); + target_ue->source_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Target-UE-ID %d has already been removed " + "(ENB_UE_S1AP_ID%d MME_UE_S1AP_ID%d)", + source_ue->target_ue_id, + source_ue->enb_ue_s1ap_id, source_ue->mme_ue_s1ap_id); + + } else if (enb_ue->source_ue_id >= OGS_MIN_POOL_ID && enb_ue->source_ue_id <= OGS_MAX_POOL_ID) { target_ue = enb_ue; source_ue = enb_ue_find_by_id(enb_ue->source_ue_id); - ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && - source_ue->target_ue_id <= OGS_MAX_POOL_ID); + if (source_ue) { + ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && + source_ue->target_ue_id <= OGS_MAX_POOL_ID); + source_ue->target_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Source-UE-ID %d has already been removed " + "(ENB_UE_S1AP_ID%d MME_UE_S1AP_ID%d)", + target_ue->source_ue_id, + target_ue->enb_ue_s1ap_id, target_ue->mme_ue_s1ap_id); + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && target_ue->source_ue_id <= OGS_MAX_POOL_ID); - source_ue->target_ue_id = OGS_INVALID_POOL_ID; target_ue->source_ue_id = OGS_INVALID_POOL_ID; } } @@ -4253,6 +4269,7 @@ { sgw_ue_t *source_ue = NULL; sgw_ue_t *target_ue = NULL; + ogs_assert(sgw_ue); if (sgw_ue->target_ue_id >= OGS_MIN_POOL_ID && @@ -4262,20 +4279,33 @@ ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && source_ue->target_ue_id <= OGS_MAX_POOL_ID); - ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && - target_ue->source_ue_id <= OGS_MAX_POOL_ID); source_ue->target_ue_id = OGS_INVALID_POOL_ID; - target_ue->source_ue_id = OGS_INVALID_POOL_ID; + + if (target_ue) { + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && + target_ue->source_ue_id <= OGS_MAX_POOL_ID); + target_ue->source_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Target-UE-ID %d has already been removed " + "(SGW-S11-TEID%d)", + source_ue->target_ue_id, source_ue->sgw_s11_teid); + } else if (sgw_ue->source_ue_id >= OGS_MIN_POOL_ID && sgw_ue->source_ue_id <= OGS_MAX_POOL_ID) { target_ue = sgw_ue; source_ue = sgw_ue_find_by_id(sgw_ue->source_ue_id); - ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && - source_ue->target_ue_id <= OGS_MAX_POOL_ID); + if (source_ue) { + ogs_assert(source_ue->target_ue_id >= OGS_MIN_POOL_ID && + source_ue->target_ue_id <= OGS_MAX_POOL_ID); + source_ue->target_ue_id = OGS_INVALID_POOL_ID; + } else + ogs_error("Source-UE-ID %d has already been removed " + "(SGW-S11-TEID%d)", + target_ue->source_ue_id, target_ue->sgw_s11_teid); + ogs_assert(target_ue->source_ue_id >= OGS_MIN_POOL_ID && target_ue->source_ue_id <= OGS_MAX_POOL_ID); - source_ue->target_ue_id = OGS_INVALID_POOL_ID; target_ue->source_ue_id = OGS_INVALID_POOL_ID; } } @@ -5030,80 +5060,81 @@ return 0; } -/* Backup the sensitive security context fields from the UE context */ -void mme_backup_security_context( - mme_ue_t *mme_ue, mme_security_context_t *backup) +/* + * Save the sensitive (partial) context fields + * from the UE context into the memento + */ +void mme_ue_save_memento(mme_ue_t *mme_ue, mme_ue_memento_t *memento) { ogs_assert(mme_ue); - ogs_assert(backup); + ogs_assert(memento); - memcpy(&backup->ue_network_capability, + memcpy(&memento->ue_network_capability, &mme_ue->ue_network_capability, - sizeof(backup->ue_network_capability)); - memcpy(&backup->ms_network_capability, + sizeof(memento->ue_network_capability)); + memcpy(&memento->ms_network_capability, &mme_ue->ms_network_capability, - sizeof(backup->ms_network_capability)); - memcpy(&backup->ue_additional_security_capability, + sizeof(memento->ms_network_capability)); + memcpy(&memento->ue_additional_security_capability, &mme_ue->ue_additional_security_capability, - sizeof(backup->ue_additional_security_capability)); - memcpy(backup->xres, mme_ue->xres, OGS_MAX_RES_LEN); - backup->xres_len = mme_ue->xres_len; - memcpy(backup->kasme, mme_ue->kasme, OGS_SHA256_DIGEST_SIZE); - memcpy(backup->rand, mme_ue->rand, OGS_RAND_LEN); - memcpy(backup->autn, mme_ue->autn, OGS_AUTN_LEN); - memcpy(backup->knas_int, mme_ue->knas_int, + sizeof(memento->ue_additional_security_capability)); + memcpy(memento->xres, mme_ue->xres, OGS_MAX_RES_LEN); + memento->xres_len = mme_ue->xres_len; + memcpy(memento->kasme, mme_ue->kasme, OGS_SHA256_DIGEST_SIZE); + memcpy(memento->rand, mme_ue->rand, OGS_RAND_LEN); + memcpy(memento->autn, mme_ue->autn, OGS_AUTN_LEN); + memcpy(memento->knas_int, mme_ue->knas_int, OGS_SHA256_DIGEST_SIZE / 2); - memcpy(backup->knas_enc, mme_ue->knas_enc, + memcpy(memento->knas_enc, mme_ue->knas_enc, OGS_SHA256_DIGEST_SIZE / 2); - backup->dl_count = mme_ue->dl_count; - backup->ul_count = mme_ue->ul_count.i32; - memcpy(backup->kenb, mme_ue->kenb, OGS_SHA256_DIGEST_SIZE); - memcpy(backup->hash_mme, mme_ue->hash_mme, OGS_HASH_MME_LEN); - backup->nonceue = mme_ue->nonceue; - backup->noncemme = mme_ue->noncemme; - backup->gprs_ciphering_key_sequence_number = + memento->dl_count = mme_ue->dl_count; + memento->ul_count = mme_ue->ul_count.i32; + memcpy(memento->kenb, mme_ue->kenb, OGS_SHA256_DIGEST_SIZE); + memcpy(memento->hash_mme, mme_ue->hash_mme, OGS_HASH_MME_LEN); + memento->nonceue = mme_ue->nonceue; + memento->noncemme = mme_ue->noncemme; + memento->gprs_ciphering_key_sequence_number = mme_ue->gprs_ciphering_key_sequence_number; - memcpy(backup->nh, mme_ue->nh, OGS_SHA256_DIGEST_SIZE); - backup->selected_enc_algorithm = mme_ue->selected_enc_algorithm; - backup->selected_int_algorithm = mme_ue->selected_int_algorithm; + memcpy(memento->nh, mme_ue->nh, OGS_SHA256_DIGEST_SIZE); + memento->selected_enc_algorithm = mme_ue->selected_enc_algorithm; + memento->selected_int_algorithm = mme_ue->selected_int_algorithm; } -/* Restore the sensitive security context fields into the UE context */ -void mme_restore_security_context( - mme_ue_t *mme_ue, const mme_security_context_t *backup) +/* Restore the sensitive context fields into the UE context */ +void mme_ue_restore_memento(mme_ue_t *mme_ue, const mme_ue_memento_t *memento) { ogs_assert(mme_ue); - ogs_assert(backup); + ogs_assert(memento); memcpy(&mme_ue->ue_network_capability, - &backup->ue_network_capability, + &memento->ue_network_capability, sizeof(mme_ue->ue_network_capability)); memcpy(&mme_ue->ms_network_capability, - &backup->ms_network_capability, + &memento->ms_network_capability, sizeof(mme_ue->ms_network_capability)); memcpy(&mme_ue->ue_additional_security_capability, - &backup->ue_additional_security_capability, + &memento->ue_additional_security_capability, sizeof(mme_ue->ue_additional_security_capability)); - memcpy(mme_ue->xres, backup->xres, OGS_MAX_RES_LEN); - mme_ue->xres_len = backup->xres_len; - memcpy(mme_ue->kasme, backup->kasme, OGS_SHA256_DIGEST_SIZE); - memcpy(mme_ue->rand, backup->rand, OGS_RAND_LEN); - memcpy(mme_ue->autn, backup->autn, OGS_AUTN_LEN); - memcpy(mme_ue->knas_int, backup->knas_int, + memcpy(mme_ue->xres, memento->xres, OGS_MAX_RES_LEN); + mme_ue->xres_len = memento->xres_len; + memcpy(mme_ue->kasme, memento->kasme, OGS_SHA256_DIGEST_SIZE); + memcpy(mme_ue->rand, memento->rand, OGS_RAND_LEN); + memcpy(mme_ue->autn, memento->autn, OGS_AUTN_LEN); + memcpy(mme_ue->knas_int, memento->knas_int, OGS_SHA256_DIGEST_SIZE / 2); - memcpy(mme_ue->knas_enc, backup->knas_enc, + memcpy(mme_ue->knas_enc, memento->knas_enc, OGS_SHA256_DIGEST_SIZE / 2);
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/src/mme/mme-context.h -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/src/mme/mme-context.h
Changed
@@ -342,7 +342,7 @@ ogs_pool_id_t mme_ue_id; }; -typedef struct mme_security_context_s { +typedef struct mme_ue_memento_s { /* UE network capability info: supported network features. */ ogs_nas_ue_network_capability_t ue_network_capability; /* MS network capability info: supported network features. */ @@ -403,7 +403,7 @@ /* Selected algorithms (set by HSS/subscription) */ uint8_t selected_enc_algorithm; uint8_t selected_int_algorithm; -} mme_security_context_t; +} mme_ue_memento_t; struct mme_ue_s { ogs_lnode_t lnode; @@ -525,11 +525,11 @@ int security_context_available; int mac_failed; - /* flag: 1 = allow restoration of security context, 0 = disallow */ - bool can_restore_security_context; + /* flag: 1 = allow restoration of context, 0 = disallow */ + bool can_restore_context; - /* Backup of security context fields */ - mme_security_context_t sec_backup; + /* Memento of context fields */ + mme_ue_memento_t memento; /* Security Context */ ogs_nas_ue_network_capability_t ue_network_capability; @@ -1215,10 +1215,8 @@ uint8_t mme_selected_int_algorithm(mme_ue_t *mme_ue); uint8_t mme_selected_enc_algorithm(mme_ue_t *mme_ue); -void mme_backup_security_context( - mme_ue_t *mme_ue, mme_security_context_t *backup); -void mme_restore_security_context( - mme_ue_t *mme_ue, const mme_security_context_t *backup); +void mme_ue_save_memento(mme_ue_t *mme_ue, mme_ue_memento_t *memento); +void mme_ue_restore_memento(mme_ue_t *mme_ue, const mme_ue_memento_t *memento); #ifdef __cplusplus }
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/tests/attach/crash-test.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/tests/attach/crash-test.c
Changed
@@ -103,6 +103,7 @@ } #endif +#if 0 static void test4_func(abts_case *tc, void *data) { int rv; @@ -405,6 +406,7 @@ test_ue_remove(test_ue); } +#endif static void test5_func(abts_case *tc, void *data) { @@ -449,7 +451,38 @@ #if 0 /* Commenting to suppress error messages */ abts_run_test(suite, test3_func, NULL); #endif + +/* +Assume the UE has attached, the session has been created, and is in the +IDLE state with the UEContextRelease process. This may lead to the following +call flow: +1. TAU request without integrity protection +2. Authentication request/response +3. Security-mode command/complete + +The MME may be processed concurrently by the HSS (S6A) and the UE (S1AP) +as follows: + - Update-Location-Request + - Service request + - Service reject + - Delete Session Request + - Delete Session Response + - Update-Location-Answer + - UEContextReleaseCommand for Service reject + - TAU reject + - UEContextReleaseCommand for TAU reject + - UEContextReleaseComplete (for Service reject) + - UEContextReleaseComplete (for TAU reject) + +If the Update-Location-Answer is received before the Delete Session Response, +the session still exists, and a TAU accept may be received. This causes the +test procedure to wait indefinitely. Due to this issue, the test code has +been commented out. +*/ +#if 0 abts_run_test(suite, test4_func, NULL); +#endif + abts_run_test(suite, test5_func, NULL); return suite;
View file
open5gs_2.7.2.4636.10b1.202503202026.tar.xz/tests/unit/nas-message-test.c -> open5gs_2.7.2.4639.a551.202503212026.tar.xz/tests/unit/nas-message-test.c
Changed
@@ -410,9 +410,9 @@ ABTS_INT_EQUAL(tc, OGS_ERROR, rv); rv = ogs_nas_gprs_timer_3_from_sec(&gprs_timer, 60*2); ABTS_INT_EQUAL(tc, OGS_OK, rv); - ABTS_INT_EQUAL(tc, OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_1_MM, + ABTS_INT_EQUAL(tc, OGS_NAS_GPRS_TIMER_3_UNIT_MULTIPLES_OF_30_SS, gprs_timer.unit); - ABTS_INT_EQUAL(tc, 2, gprs_timer.value); + ABTS_INT_EQUAL(tc, 4, gprs_timer.value); rv = ogs_nas_gprs_timer_3_from_sec(&gprs_timer, 60*2+1); ABTS_INT_EQUAL(tc, OGS_ERROR, rv); rv = ogs_nas_gprs_timer_3_from_sec(&gprs_timer, 60*30);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.